You should just be able to do: x = matchQuaternion.x y = matchQuaternion.y z = matchQuaternion.z
On Wed, Apr 7, 2010 at 2:47 PM, Visor66 <[email protected]>wrote: > Hello everyone, > > im trying to use the MQuaternion.get() function to extract x,y,z > values from a quaternion. Documentation says its giving me back an > array with 4 doubles. Whats the right way to use MScriptUtil() to > prepare a python variable to work with this function. This is how I > thought it could work: > > rotValues = OpenMaya.MScriptUtil() > rotValues.createFromList([0.0,0.0,0.0,0.0],4) > rotValuesPtr = rotValues.asDouble4Ptr() > matchQuaternion.get(rotValuesPtr) > > Im getting back this error message: > > # Error: TypeError: in method 'MQuaternion_get', argument 2 of type > 'double [4]' # > > The funny thing is, when I use rotValuesPtr = rotValues.asDoublePtr() > it works, but I only get the x value. So how would it be correct to > actually get all values from get() ? > > thanks for any help! > > -- > http://groups.google.com/group/python_inside_maya > > To unsubscribe, reply using "remove me" as the subject. > -- http://groups.google.com/group/python_inside_maya
