View Full Version : how to get unlocked joint rotations

01 January 2011, 10:51 PM
I'm trying to access the joint rotations associated with a joint, but I only want the free/unlocked rotations. Is there a way to only get the unlocked rotations .... or to determine if the rotation axis is locked ?

MEulerRotation rotation;
MFnTransform transformMatrix(joint[i].node());
transformMatrix.getRotation(rotation); // need to differentiate between locked and unlocked

01 January 2011, 11:25 PM
So what i needed to do was, create a plug to the joint's rotation axes and then query them to see if they were locked or not.

MFnDependencyNode jointNode;
MPlug rotX = jointNode.findPlug("rotateX", &stat);
MPlug rotY = jointNode.findPlug("rotateY", &stat);
MPlug rotZ = jointNode.findPlug("rotateZ", &stat);

if (!rotX.isLocked())
// do work
if (!rotY.isLocked())
// do work
if (!rotZ.isLocked())
// do work

CGTalk Moderation
01 January 2011, 11:25 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.