Relative Content

Tag Archive for pythonmaya

Querying Component Axis Orientation in Maya

I’m trying to access the values that are given when the Axis Orientation of the move tool is set to Component.
For simplicity, I’m trying to align a locator to the position and orientation of a vertex, edge or face component that is selected. I can get the position using the xform command cmds.xform(q=True, ws=True, t=True) however there doesn’t seem to be any way to get the orientation. The various xform rotate queries just give back [0,0,0].
I’ve tried manipMoveContext and manipPivot but haven’t been able to get anything from either.
If I copy the values from the move tool axis orientation, when set to component mode, and use those as the rotation values of the locator then it works perfectly. But I can’t find how to access these values to use in a Python script.