Rigging the Legs

Let’s jump into the legs, which will be a little trickier. Figure 11.4 shows the different steps of the process and the step-by-step instructions follow. You’ll use Inverse Kinematics (IK) to create the legs.

Image

Figure 11.4 Rigging the leg with Inverse Kinematics

Before you start following the steps, you should know what IK is. Usually, when you create a bone structure such as the leg, if you try to pose it you’ll find that you have to rotate each bone and its children will follow their parent. For the leg, you should rotate the thigh, then the ankle, and then the foot. This way of working is called Forward Kinematics (FK), but for cases such as the legs or parts of the rig that need to touch surfaces (like the feet), Inverse Kinematics is a much better option.

IK works in a way that is opposite to FK and to pose the leg, you would only have to move the foot and the knee would flex accordingly to reflect that movement. This is very useful because when you move the character’s torso, the legs will automatically flex and move to make the feet stand on the floor.

1. Extrude a bone from the knee joint (name it C_leg_pole) and another one from the heel joint (name it H_leg_ik). With the new bones selected, press Alt + P to clear their parents and disconnect them from the rest of the leg. Take C_leg_pole and move it forward a little so it’s in front of the leg (it should be right in front of, and aligned with, the knee).

2. In Pose Mode, select H_leg_ik; this will be the target of the IK chain. Press Shift, select D_ankle. Now add a constraint with Shift + Ctrl + C and select Inverse Kinematics; or, you can press Shift + I, which will apply the IK directly. Now go to the Constraints tab in the Properties Editor and, in the IK constraint, there are a couple of values you’ll have to adjust.

First is the Chain Length. By default, the IK will go up to the root of the hierarchy (which, in this case, is the C_root bone). Set the Chain Length value to 2; this way, the IK will only work up to 2 bones in the hierarchy, which in this case are the ankle and the thigh. At this point, if you move the C_root bone or the H_leg_ik bone, you’ll see the effect of the IK.

Second, let’s give this IK a pole. IK makes the bones of the leg flex in a plane and the pole will define that plane, so with it you’ll be able to orient the leg. In the Pole Target field of the Inverse Kinematics constraint on the Bone Constraints tab, insert the rig’s name (in this case Jim_rig) and the bone field will appear. Insert the name of the pole bone (in this case C_leg_pole). Move C_leg_pole now and you’ll see its effect.


Caution

Due to the orientation of the bones, sometimes when you apply a pole to an IK chain, you’ll see that the IK becomes rotated. You can compensate for this by adjusting the Pole Angle value in the IK constraint. Usually, if bones are correctly aligned, round values like 90°, -90°, or 180° are enough to correct that rotation.


3. With the 3D cursor aligned with the foot bones, create a new bone chain. Start the first bone from the heel (use the 3D model as a reference for this, as these bones will define the pivot points to rotate the foot), the second bone from the toe tip, and the third bone from the toe articulation. The point circled in red in the image is the point to which all those joints should be aligned: that will prevent sliding later when you rotate those bones. These three bones will control the foot’s movement so you can rotate the foot from the heel to the toe and roll it when it walks. The H_leg_ik bone has to be a child of C_foot_roll, so it follows its parent later.

4. Now you also need IKs in the foot so you’re able to control it while you use the IK leg, otherwise it will rotate around on its own. Create a new bone from the toe articulation and name it C_toe: it will control the toe when it’s not touching the ground. Now, from that toe articulation and from the tail of the D_toe bone, extrude a couple of bones and disconnect them: they’ll be the targets of the IKs you’ll use in the foot. Duplicate those two targets and move them up so they’ll be the poles for the foot IKs.

Don’t forget to parent the extruded bones correctly: the IK target and pole of D_foot are children of C_foot_roll, the IK target and pole of D_toe are children of C_toe, and C_toe is a child of C_foot_tip. This may sound very tricky, but once you have it working, you’ll understand why everything needs this hierarchy.

5. Finally, jump again to Pose Mode and add the IK constraints for D_foot and D_toe. Use the targets and poles you created in step 4 for that purpose and, in the Chain Length values, use 1.

6. In Pose Mode, move and rotate the controller bones (the ones that have been prefixed with C_) and you’ll see how the deform bones move naturally as they follow the controllers. When you rotate C_foot_tip, the whole foot rotates around the tip, and when you rotate C_foot_roll, the heel lifts up while the toe stays in place, which is very useful when you have to make your character walk. With C_foot you can move the whole foot around and with C_toe you can rotate the toe alone, if necessary (usually when the foot is not touching the ground). Jim’s leg is now rigged!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.55.35