FK/IK Match Tool in Maya Basics
Say you are making an animation using your rig's FK controllers, but you just decided it'd be better to animate them in IK instead. Oh no!
Ideally, if that's a problem you run into often, your technical animator would have written you a tool that enables you to switch between the two controller types with just the click of a button!
The FKIK Match Tool is a common request from animators. It's a little tricky to write a "global" tool that would work for any rig, but I have seen some attempts online. In this post I'll talk about my approach using locators and parent-constraints. It works specially well if your animator is working on an autorigger-made rig or a studio-standard rig.
In this technique we have locators parented under our FK joints and IK joints; when we want to match the FK controllers to the IK, we parent-constrain them to the IK joint locators and delete the constraints, and vice-versa. I know it sounds confusing but stay with me, I made some diagrams to clarify! Everyone loves my diagrams!
The advantage of building an FKIK Match Tool as an add-on to an existing autorigger is that we can modify our existing autorigger code to add these locators while it is building the rig. You can store them inside an "extras_group" and make them invisible. We can also give our locators naming conventions that make them easier for the tool to find.
Three things: Controllers, joint chains, and locators
Those are the three types of nodes we're going to be working with. To match the IK controllers, you will have two locators parented directly under the FK joint chain: one under the FK elbow joint and the other is under the FK hand joint.
To match the FK controllers, we'll have three locators parented directly under our IK shoulder joint, IK elbow joint and IK hand joint. Please note the hierarchy in the picture below:
The yellow joint chain is the IK joint chain.
The pink joint chain is the FK joint chain.
There are two locators (IK_poleVec_loc, IK_hand_loc) parented under the FK elbow and FK hand joints.
There are three locators (FK_shoulder_loc, FK_elbow_loc, FK_hand_loc) parented under the IK shoulder, IK elbow and IK hand joints.
IK to FK Matching
When we want to match our IK controllers to the FK chain, our tool will parent-constrain the IK pole vector control to the IK_poleVec_loc, and the IK hand control to the IK_hand_loc. Don't forget to delete the constraints when you're done! You might also want to give your animator the option of keying the controls and/or FKIK switch attributes.
FK to IK Matching
Now if we want to match our FK controllers to the IK chain, our tool will parent-constrain the FK shoulder, FK elbow and FK hand controls to the FK_shoulder_loc, FK_elbow_loc and FK_hand_loc respectively. It is VERY important to start with the top control/joint (in this case the shoulder) and then work your way down, or else your controls won't match correctly.
If you have trouble figuring out which control/joint is the top of the chain, you can query how many children a particular node has using cmds.listRelatives(). The more children a node has, the higher in the FK chain it should be. I'm sure there's a more elegant way to do this but I'm Brazilian and my tools shall be written in the most Brazilian-efficient way possible.
The more I write this post the more I realize I should make a video explaining it; this was very tough to put in words.... I'll probably write a sample script with comments and share it as well. Hmmmm yes that's a good idea.
Welp, that's all for today!