Reverse Foot Lock & IK/FK Switch In Maya



In this tutorial, new Cgtuts+ author Ranjit Singh Rana will be covering the process of setting up a "Reverse foot lock" rig in Maya. First Ranjit will show us how to create it using a 'chain of joints' and then again using 'groups'. Finally Ranjit will show us how to setup an "IK/FK switch" for an arm. We'll also take a look at adding 'Set Driven Keys' for both the Reverse foot lock and IK/FK switch.
Step 1
To start, first create a joint setup as mentioned in the image below, and rename the joints accordingly. So Hip to 'Hip_jnt', Knee to 'Knee_jnt', Ankle to 'Ankle_jnt', Ball to 'Ball _jnt' and Toe to 'Toe_jnt'.



Step 2
Now go to the Skeleton menu and click on 'IK Handle Tool' options, and then from the 'IK Handle Settings' select IKRPsolver and create a IK handle from the Hip to Ankle joint.



Step 3
Again go to the IK Handle settings and select IKSC solver and create two IK handles, first from the 'Ankle' to 'Ball' joint, and the second from the 'Ball' to 'Toe' joint. So now the 'IKHandle1' is from the 'Hip' to 'Ankle joint', the 'IKHandle2' is from the 'Ankle' to 'Ball' joint and the 'IKHandle3' is from the 'Ball' to 'Toe joint'.



Step 4
Now create a chain of joints as mentioned in the image below for the joint setup, and rename it accordingly.



Step 5
Select the 'Rl_base' joint and Press Ctrl+A, from the Attribute editor go to 'Drawing Overrides' and check 'Enable Overrides', and choose a different color.



Step 6
Also increase the radius size from attribute editor, increase the radius for 'Rl_toe', 'Rl_ball' and 'Rl_ankle' the same way. Now it will be easier to select any joint from this hierarchy independently.



Step 7
Select 'Rl_base' and move the joint up while pressing the X key on the keyboard (snap to grid), now 'Rl_toe' is snapped with 'Toe_jnt', 'Rl_ball' with 'Ball_jnt and 'Rl_ankle' with 'Ankle_jnt'.



Step 8
Now select the 'Rl_ankle' joint first, and then select 'IKHandle1' and go to the Constrain menu and click on 'Point' constrain. Using the same method, apply a point constrain between 'Rl_ball' and 'IKHandle2' and 'Rl_toe' and 'IKHandle3'.



Step 9
Next, create a controller like the one shown in the image below, 'Rl_base', press D first, then V while holding the first key, then snap the pivot of the curve to the 'Rl_base' using the middle mouse button. 'Freeze transform' from 'Modify' and Delete by type History from edit menu.



Step 10
Now select the 'feet_cntrl' curve and the 'Rl_base' and 'Parent' constrain them from the constrain menu.



Step 11
Now select the the 'Feet_cntrl' curve, and from the channel box, click on 'Add attribute' from the edit menu.



Step 12
Add attribute 'Ball_roll', keep the data type on Float, set the Min value to -5, Max to 10 and Default to 0 (as shown.)



Step 13
Add another attribute 'Toe_roll', keep the data type on Float, set the Min value to -5, Max to 10 and Default to 0



Step 14
Now go to Animate>Set Driven Key>Set... from animation module.



Step 15
Select 'feet_cntrl' and click on the 'Load Driver' from the 'Set Driven Key' option box. Select the 'Rl_ball' joint and click on the 'Load Driven'. Now you'll see 'feet_cntrl' in the left pane of Driver section and their attributes in the right pane, including two attributes that we've added 'ball_roll' and 'Toe_roll'. 'Rl_ball' in the left pane of the Driven section and their attributes in the right pane.



Step 16
Now select the 'ball_roll' attribute of 'feet_cntrl' and the 'Rotate Z' attribute of 'Rl_ball', rotation axis can be confirmed by rotating the 'Rl_ball' joint in the viewport. Now click on the key and you'll see the 'Rotate Z' attribute of the 'Rl_ball' turns pink, this means the connection has been created for the default value of the 'ball_roll' attribute.



Step 17
Now select 'feet_cntrl', which can also be selected by clicking it in the 'Set Driven Key' option, and set the value of 'Ball roll' to 10, select 'Rl_ball' and rotate it on the Z axis, or manualy give it some value. In my case it's 40 and than click on key.



Step 18
Again select the feet_cntrl, and set the value of ball roll to -5 and Rotate Z of Rl_ball to -15.



Step 19
Now select 'Rl_toe' from the outliner and Create Set Driven Keys as we've created for 'Rl_ball'. When 'Toe roll' is 0 click key on the default value of 'Rl_toe'.



Step 20
When 'Toe roll' is at 10 Rotate Z of 'Rl_toe' is 70.



Step 21
And when 'Toe roll' is -5 Rotate Z of 'Rl_toe' is -8. And here we are done with the first method of Reverse foot lock.



Step 22
This is the second method of creating 'Reverse foot lock'. Follow Steps 1 to 3 and then rename the 'IKHandle 1' to 'Ankle_ik', 'IKHandle 2' to 'Ball_ik' and 'IKHandle 3' to 'Toe_ik', as shown.



Step 23
Now select the 'Ankle_ik' and group it by pressing Ctrl+g, rename the group 'Ankle_IK_grp', and snap the pivot of this group to the ball position.



Step 24
Select the other two IK handles 'Ball_ik' and 'Toe_ik' and group them. Rename this group 'Ball_toe_ik', and snap the pivot of this group to the same ball joint position.



Step 25
Now select these two groups 'Ankle_ik_grp' and 'Ball_toe_ik' and group them by pressing Ctrl+g, rename this group 'Toe_ik_grp', and snap the pivot of this group to the toe joint.



Step 26
Create one more group of 'Toe_ik_grp', rename it 'Heel_ik_grp', snap the pivot of this group to the ankle joint position.



Step 27
Now create a controller curve 'Foot_cntrl' as we did previously in Step 9, and snap the pivot of this controller curve to the ball joint position. Freeze transform and delete the history of 'foot_cntrl'.



Step 28
Select the 'Heel_ik_grp' from the outliner, and then Shift select the 'foot_cntrl' and press P on the keyboard. You can lock and hide the scale attributes of foot_cntrl.



Step 29
Select the 'foot_cntrl' and five attribute. First, set the 'Ball_roll' to Min 0, Max 10, default 0.



Step 30
Second attribute, 'Toe_roll' Min 0, Max 10, Default 0.



Step 31
Third attribute, 'Toe_tap' Min -10, Max 10, Default 0.



Step 32
Fourth attribute, 'Toe_twist', Min -10, Max 10, Default 0.



Step 33
And the last attribute 'Heel_twist', Min -10, Max 10, Default 0.



Step 34
Now go to Animate>Set Driven Key>Set, and select 'foot_cntrl' and click on 'Load Driver'. Select 'Ankle_ik_grp' and click on 'Load Driven'. Create a set driven key between the 'Ball_Roll' attribute of 'foot_cntrl' and the 'Rotate X' attribute for the 'Ankle_ik_grp'.



Step 35
When the 'Ball Roll' of 'foot_cntrl' is at 10, set the 'Rotate X' of 'Ankle_ik_grp' to 30 and key it.



Step 36
Now select the 'Toe_ik_grp' and click on Load Driven. Create a Set Driven Key between the 'Toe Roll' attribute of 'foot_cntrl' and the 'Rotate X' for the 'Toe_ik_grp' and key it.



Step 37
When the 'Toe Roll' of 'foot_cntrl' is at 10, set the 'Rotate X' of 'Toe_ik_grp' to 60 and key it.



Step 38
Select the 'Ball_toe_ik group' and click on Load Driven. Create a Set Driven Key between the 'Toe_tap' attribute of 'foot_cntrl' and the 'Rotate X' for the 'Ball_toe_ik'.



Step 39
In the same way, create a set driven key between the 'Toe_twist' attribute of 'foot_cntrl' and the 'Rotate Y' attribute of 'Toe_ik_grp.



Step 40
And the 'Heel_twist' attribute of 'foot_cntrl' with 'Rotate Y' of 'Heel_ik_grp'. And with this, you're done with the second method of the 'Reverse foot lock'.



Step 41
Now, from here I’m going to explain the 'IK/FK switch' for the arm. Create a joint setup for the arm and rename it according to the image below..



Step 42
First let's create a controller for forward Kinematics (FK), create three circles and snap them to the shoulder, elbow and wrist joints. Rename them 'Shldr_cntrl', 'Elbow_cntrl' and 'Wrist_cntrl' respectively.



Step 43
'Freeze transformations' and delete the history of all three.

Step 44
Select the 'Shldr_cntrl' and group it by pressing Ctrl+g on the keyboard, rename this group 'Shldr_cntrl_grp', follow the same process for the 'Elbow_cntrl' and the 'Wrist_cntrl'.



Step 45
Select these groups individually and 'center pivot' for each one from the Modify menu, (Modify>Center Pivot).

Step 46
These groups can be used to adjust the curve controller, by aligning properly to the joint.



Step 47
Now select 'Shldr_cntrl', and Shift select the 'shoulder joint'. Then click on the 'Orient Constrain Options' from the constrain menu (Constrain>Orient).



Step 48
Check 'Maintain offset' and click on the 'Add' button. Following the same process, 'Orient Constrain' the other two joints with the corresponding curves.



Step 49
Select the 'Elbw_cntrl_grp', and middle mouse drag and drop it on the 'Shldr_cntrl'. This way the 'Elbw_cntrl_grp is now a child of the 'Shldr_cntrl'. In the same way make the 'Wrist_cntrl_grp' a child of the 'Elbw_cntrl'.



Step 50
Now add a IKHandle with the IKRP solver selected, from the Shoulder to the Wrist joint.



Step 51
Create a controller as shown below, rename it 'IK_cntrl'. Then select it, and shift select the 'IKHandle' and 'Point Constrain' it from 'Constrain' menu.



Step 52
Create a controller and rename it 'Pole_vectr'. Place it as shown in the image below and Freeze Transformation, delete it's History, then select it and Shift select the IKhandle. Than click on 'polevector' from the Constrain menu.



Step 53
Create one more controller and rename it 'IK_FK'. Add the “IK_FK” attribute in the channel box and keep the data type as Enum. Change the Enum names from Green and Blue, to IK and FK respectively.



Step 54
Now go to Animate>Set Driven Key>Set, select the 'IK_FK' controller and Click on 'Load Driver' from the 'Set Driven Key' option.



Step 55
Select 1. 'Shldr_cntrl', 2. 'Elbw_cntrl', 3. 'Wrist_cntrl', 4. 'IK_cntrl', 5. 'Pole_vectr' and 6. 'IKHandle1' in the outliner and click on Load Driven.



Step 56
Now with IK highlighted for the IK FK attribute of 'IK_FK' controller.



Step 57
Turn visibility OFF for the 'Shldr_cntrl', 'Elbw_cntrl' and 'Wrist_cntrl', and then Key them.



Step 58
Keep the visibility ON for the 'IK_cntrl', 'IKHandle' and 'Pole_vectr', and also keep the 'IK Blend' set to 1 for the IKHandle, and Key them.



Step 59
Now when 'FK' is highlighted for 'IK FK' attribute.



Step 60
Turn visibility ON for the 'Shldr_cntrl', 'Elbw_cntrl' and 'Wrist_cntrl' and Key them.



Step 61
Turn visibility OFF for 'IK_cntrl', 'IKHandle' and 'Pole_vectr', and set the 'IK Blend' to 0 for the 'IKHandle', and key all of them.



