Hello,
I’m trying for the first time to do FK IK snapping in Maya using Python and the xform function, unfortunately I’ve frozen the transforms on my IK controls so when I calculate the position of the FK elbow in world space and apply it to my IK pole vector it’s essentially being applied in local space and so it doesn’t work. I’m having a similar problem with matching translation/rotation of the FK hand -> IK hand and vice versa. I had a look on the forums and found a bit of information, but no concrete answers.
For matching the translation of the FK and IK elbow and the rotation of the FK and IK hand, I’m using the following code:
fkElbowTrans = cmds.xform(fkElbow, ws=True, q=True, a=True, t=True)
cmds.xform(ikPv, ws=True, a=True, t=[fkElbowTrans[0], fkElbowTrans[1], fkElbowTrans[2]])
fkHandRot = cmds.xform(fkHand, ws=True, q=True, a=True, rp=True, ro=True)
cmds.xform(ikHand, ws=True, a=True, ro=[fkHandRot[0], fkHandRot[1], fkHandRot[2]])
An obvious solution would be not to freeze the transforms of my animation controls, but I don’t really want to do that, although I had a look at AnimationMentor’s Stewie rig and by default it has non-zero values in its translation and rotation channels.
-Harry