I am trying to use OpenMaya to copy rotations from the Bound Joints of a full IK/FK anim rig, to a Skeleton Rig for use in a game engine. Trying to automate the process to save people time.
I’ve reached the stupidest roadblock right now.
I create two lists/arrays of the bound joints in the Anim Rig and Skeleton Rig from the DAG hierarchy in the scene.
# Check whether the name contains the Bound Joint String Indicator if aBind in dagNodeFn.name(): # If so, check whether the name contains the Rig Type Indicator if aRig in dagNodeFn.name(): jointList.append(dagObject)
Those lists are passed to the Copy Script, which uses simple name-matching.
I want to just copy the blooming rotations from like-named-joint to like-named-joint.
if(animJointName == skelJointName): print 'Copy from ' + animJointName + ' to ' + skelJointName animJTransformFN = OpenMaya.MFnTransform(animJ) print 'Transform: ' + str(animJTransformFN) animRotation = animJTransformFN.getRotation() print 'Rotation: ' + str(animRotation) skelDagNodeFn.setRotation(animRotation) break
But I am told by Maya that I have the wrong number or type of arguments for getRotation()
These are the suggested solutions. Am I just totally misunderstanding the syntax of what I am trying to do?
getRotation(MFnTransform const *,MQuaternion &,MSpace::Space) getRotation(MFnTransform const *,MEulerRotation &) getRotation(MFnTransform const *,double ,MTransformationMatrix::RotationOrder &) getRotation(MFnTransform const *,double ,MTransformationMatrix::RotationOrder &,MSpace::Space)
Can anyone enlighten me? If I am not passing the Joint Transform to the getRotation() function? If not how do I access it?