TutorialsTrainingGolemNewsHome

Legs

Part 2: 1-Joint IK

Start by opening NobbsLegs.c4d. This is a character that already has a bone structure in the legs (see Part 1 for the HowTo). This tutorial will present one method for rigging a character's legs.
In this rig you simply animate the position of your foot object. The thigh and shin automatically rotate to follow the foot. The foot itself (foot + toe) is animated with FK. This rig is useful for walk cycles and actions where you need exact positioning of the heel of your object. The disadvantage of this rig is that it is difficult to get arcing motions.

Step 1: Setting up the Hiearchy
To create an IK based rig, you need a hierarchy and a target object that can be animated independently of that hierarchy. In this case we want our thigh and shin to target the foot. In order for this to work, we need to separate the feet from the legs in the hierarchy. Do this by dragging "Foot R" and "Foot L" above "Root" in the object Manager while keeping it a child of "Mesh".

Step 2: Anchoring Bones
IK works by rotating all of the bones from of the top of the hierarchy down to the "effector" so that the effector remains in contact with the target. If you don't want IK to affect objects at the top of the hierarchy you can define the top-most object that IK will affect using an "anchor tag". In this case we want IK to stop at the "Thigh 00" bones. Select "Thigh 00 R" then select Object Manager->File->New Tag->Anchor Tag. Follow the same process for "Thigh 00 L" (or copy the tag from one thigh to the other). We also want to make sure we don't accidentally move or rotate the Thigh 00 bones as this would defeat their purpose. In order to prevent accidental movement we need to add a protection tag. Select "Thigh 00 R" then choose Object Manager->File->New Tag->Protection Tag. Follow the same process for "Thigh 00 L" (copying the tag will NOT work in this case).

Step 3: Adding Effectors
In order for IK to work properly, you must have an effector object at the bottom of the hierarchy you want to be affected by IK. This effector should be placed at the point in your hierarchy that you want to touch the target. In our case, the effector should be at the base of the shin bone. To add these effector objects we will be using AdjustBones (Plugins->Golem->AdjustBones). Select "Shin L" and then in the AdjustBones dialog click on the "Add Null" button. Now select "Shin R" and click on the "Add Null" button again.

Step 4: Storing Resting Bone Rotations
Whenever you start doing any complex rigging, its a good idea to back up the position/scale/rotation of your bone hierarchy when it is in its default state. There are a couple ways to accomplish this. I tend to do it by fixing and resetting all of the bones in my character (when you fix bones, they store their current/default position/scale/rotation). To do this, select "Mesh" then in the Object Manager select Objects->Fix Bones. Click "OK" on the dialog that pops up, then select Objects->Reset Bones. You won't notice any difference in the appearance of your bones, but you have just successfully stored the default pose of these bones.

Step 5: Adding IK Solvers
Our hierarchy is now primed and ready for IK. To add IK to our legs we need to add IK Expressions to our effector objects. Select "Shin L Null" then choose Object Manager->File->New Expression->IK Expression. Type "Foot L" into the "search for" field of the dialog that pops up, then click on OK. Do the same for "Shin R Null" except this time, type in "Foot R". You can now move either of your foot objects and the legs will automatically rotate to reach. However, you might notice that some of these rotations look a bit off. The next step will address that. (After you have played around, select Mesh and choose Reset Bones)

Step 6: Improving the IK Solution
Right now the legs are reaching their targets, unfortunately the knees are pointing any way they please. We can give the IK solver "hints" so that it acts more like we want it to. One of the best ways to hint is by adding an AimAt constraint to the thigh which is targeted to a "knee" object. To do this, we need to add a target at the position of the knee. There are a couple ways to do this: add a Null Object and manually position it, or use the "Add Null" button that is a part of AdjustBones. Which method you use is up to you. After you have created two null objects (one at the position of each knee), name them "Knee L" and "Knee R". Now child "Knee L" and "Knee R" directly to "Root". Now that we have the knee targets positioned we can set up the IK Hints. Select "Thigh L" and add an AimAt Constraint. Drag "Knee L" into the target field. Select "Thigh R" and do the same, but the target should be "Knee R". You now have an IK chain that is properly hinted.

Note: To get the best results, the knee targets should be a number of units in front of the knee joint itself, otherwise it is very easy for the knees to hyper-extend. Also, to have the knees automatically rotate out with the feet, child the Knee objects to their respective feet. The one downside of this is: when the feet are rotated back very dramatically the knees will "pop". This can be easily fixed by animating the position of the Knee targets. Where you place the knees in the hierarchy mainly comes down to an issue of style.

Step 7: Keeping Targets in a Reachable Range

Our leg rig is functioning very well. There is really only one serious flaw remaining: It is possible to separate the feet from the legs. We can use a Leash constraint to keep the feet within range of the legs. Before we add the Leash constraints to our feet we should first turn off the evaluation of expressions (Coffee cup icon on the lower left side of the screen), we do this so that the feet don't snap to an unwanted position when we add the constraints. Select Foot L and add a Leash constraint. Now drag Thigh L into the target field and click on the "C" button, this keeps the foot from ever being farther away than it is now. Follow the same process for Foot R, but drag in Thigh R. Now turn Expressions evaluation back on (Coffee cup icon).

The leg rig is now complete. You might want to fix your bones to the mesh so that you can see Nobbs deform as you move the feet around. Have fun animating!

Download the completed rig.