Hi guys, recently I try to teach myself about cryengine and found out that modo and cryengine have different up axis that give a slight problem here (even though I know UDK also have different up axis then modo, but the exported geometry fbx seems fine and not lie on d ground like cryengine did).
Wasn't able to find an official export option for modo-cryengine, what I did was record a modo's macro to rotate the object along x axis 90deg>export fbx>re-rotate object on x -90deg all in one button press, like so;
#LXMacro#
tool.set actr.origin on
select.typeFrom polygon;edge;vertex;item;pivot;center;ptag true
tool.set TransformRotate on
tool.noChange
tool.attr xfrm.transform RX 90.0
tool.doApply
tool.set TransformRotate off 0
export.selected 7 false false true
select.typeFrom polygon;edge;vertex;item;pivot;center;ptag true
tool.set TransformRotate on
tool.noChange
tool.attr xfrm.transform RX -90.0
tool.doApply
tool.set TransformRotate off 0
tool.set actr.origin off
select.typeFrom vertex;edge;polygon;item;pivot;center;ptag true
Well, it is working but somehow when I run this script first thing before doing anything after load the object it throw me "Command Disabled" for the
line 6: tool.attr but if I activate transform tool before I run the script and it will work as expected. I know it's not a major problem but does anyone know what causing this? and what's the problem with that line 6?
Or anyone got a better solution for the modo-cryengine workflow?
Replies
I've also turned this into a Python script rather than a macro. Just easier in my eyes.
However, MODO has a native "export selected" for FBX now. It's in your FBX preferences - System > Preferences > File I/O > FBX I/O > set "Export type" to "Export selection with hierarchy" or "Export selection".
So you should be able to just rotate your mesh, export to fbx and then undo the rotation, rather than using Gwynne's script - which copies all of the selected mesh items over to a new scene and then saves that, before closing the scene and returning to the one you were just in.
My previous statement about axis rotate is wrong; it did however rotate along X axis no matter what position the workplace is when I run the script, so all good!
Thanks James on helping me on this!
lx.eval('tool.setAttr axis.origin axis 0')
will change what axis it rotates on.
0 is X, 1 is Y and 2 is Z