Hi there.
I am trying to import an object, its pivot point position and its local orientation from another application (Grasshopper) and set it in Maya where it used to be.
To do so, I thought one could do this.:
1.Import the object, the values of its pivot position and a transformation Matrix-info for the local axis orientation.
2. create a locator
3. apply the transf.Matrix with "xform" to it
4.Parent the object to this locator so I could move or rotate it according to its local orientation AND have the possibility to come back to its original position by simply zero-ing its transformation channels.
So:
With the python command "xform" I tried to apply the same transformation matrix eighter to a locator or to the rotation axis of this locator. But: the results of the rotation axis orientation are completely different.
import maya.cmds as cmds
cmds.xform('locator1.rotateAxis', m=(0.93,-0.22,-0.29,13.41,0.36,0.56,0.74,8.53,0.00,-0.80,0.60,40.14,0.0,0.0,0.0,1.0))
(like this the axis actually get orientated like they supposed to be, but parenting an object to the locator is useless because it ignores the local axis when rotated)
or
import maya.cmds as cmds
cmds.xform('locator1', m=(0.93,-0.22,-0.29,13.41,0.36,0.56,0.74,8.53,0.00,-0.80,0.60,40.14,0.0,0.0,0.0,1.0))
(like that the orientation of the locators local axis is wrong, but I achieve to parent some object to it. The object rotates according to the local axis of the locator.)
could someone explain me why this is happening? Sorry for my awkward English.
Any hint would be appreciated.