XM Magdalena 3D print, GGeorgy (3D)
LC #42 Pipers Alley

View Full Version : pyMel bug?

10-17-2010, 11:52 PM

1. create a new sphere
2. set it's rotation too "100,100,100"
3 query the rotation with this:

from pymel.core import *
sel = ls(selection=True)
print sel[0].getRotation()

Result = [-80.0, 80.0, -80.0]

But if I use xform

from pymel.core import *
sel = ls(selection=True)
print xform(sel[0],query=True,rotation=True)

Result = [100.0, 100.0, 100.0]

Why the hell is getRotation returning the wrong values?



10-18-2010, 10:18 AM
You are right, the getRotation() result is wrong while
gives you the correct result. Because the getRotation() is derived from maya.OpenMaya.MSpace.getRotation(), it would be interesting in which values the API call results and if the problem lies in the wrapping pymel or in the api method.

10-18-2010, 10:52 PM
Cheers for that,

It says in the docs it return Quanterions, so maybe that has something todo with it. I'll role with your code, much nicer than xform.

CGTalk Moderation
10-18-2010, 10:53 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.