I am working on a Maya scripting tool to export animation fbx. Is there any way to zero out the transform coordinates, moving objects or hierarchies to the origin in the exported file, as the feature in Maya build-in game exporter "Move to Origin" in Python or Mel?
Asked
Active
Viewed 1,443 times
2 Answers
1
I suppose you would take the object at the top of the hierarchy of the rig and move it to the world origin. You can do this with cmds.xform
:
import maya.cmds as cmds
cmds.xform(YOUR_OBJ, ws=True, t=[0, 0, 0])
If this hasn't answered your question it's because the question is very vague and you need to provide more info.

Green Cell
- 4,677
- 2
- 18
- 49
0
It sounds like you mean freeze transforms? (i.e. the transform gets zeroed, but the geometry stays where it is). Select the geom, then from the menu, select Modify->Freeze Transformations. In a bit of MEL:
// make a cube and move it (should still be selected)
polyCube -w 1 -h 1 -d 1 -sx 1 -sy 1 -sz 1 -ax 0 1 0 -cuv 4 -ch 1;
move -r -3.885651 1.715304 2.599173 ;
And then to bake the parent transform coordinates into the vertex data:
makeIdentity -apply true -t 1 -r 1 -s 1 -n 0 -pn 1;
If you simply want the transform zeroed and the mesh re-centered at the origin, Green Cell has the answer...

robthebloke
- 9,331
- 9
- 12