xform rotate object space

569 views
Skip to first unread message

Mathew Schwartz

unread,
Feb 21, 2017, 9:04:32 PM2/21/17
to python_in...@googlegroups.com
When having an object selected, like a newly created box, performing the command:

cmds.xform(ro=(10,0,30), os=True)

gives the same result as 

cmds.xform(ro=(10,0,30), ws=True)

Both of them show the object rotation is 10,0,30 when querying the respective transformations.
I am trying to rotate in object space, 10 in x, then 30 in z.  The final rotation angles should be

x = 8.68220390105
y = -4.98092532193
z = 29.6216518752

when using 

cmds.xform(ro=(10,0,30), os=True)
cmds.xform(ro=True, ws=True, query=True)

I tried using the euler flag, relative, etc.  but can not get the correct transformation.  What am I doing wrong?

Chad Fox

unread,
Feb 22, 2017, 1:16:32 PM2/22/17
to Python Programming for Autodesk Maya
Hi Mathew

Can you share more information on the transforms and hierarchy of the object you are trying to transform? Eg. What are its parent's world space rotation values, The object's current rotation and rotation order.

Also, it may help us help you if we could know why you need or are expecting those specific final values. 

Perhaps the values you are expecting are for a rotation order different than the object that is being tested?

Let us know.

Chad


--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CADiWwnTB2GVZGGLLhAbwcnBQTdTrnS64PR5F7P76z4%3DpCvu2Dg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

justin hidair

unread,
Feb 23, 2017, 12:50:40 AM2/23/17
to Python Programming for Autodesk Maya
It's best to always test on several objects, one scaled, one rotated, one transformations frozen, ect.. and you'll find the thing eventually... May I ask why you would do all that ?
Reply all
Reply to author
Forward
0 new messages