Begin by creating an IK handle between two joints.
Open the file Dog_SkeletalHierarchy.mb from the CD that accompanies
this book. Use the IK Handle tool to create an IK handle from the
Dog_right_backLeg_1 joint to the Dog_right_backLeg_3 joint. Name the
new IK handle thighIkHandle, and freeze its transforms by choosing
the menu command Modify, Freeze Transformations while it is selected.
Create another IK handle from the Dog_right_backLeg_3 joint to the
Dog_right_backLegAnkle joint. Name this IK handle legIkHandle.
Create a locator by choosing the menu command Create, Locator. Point-snap
it to the legIKHandle by selecting the Move tool, pressing the v key,
and, while holding down the middle mouse button, dragging the locator
to legIKHandle. Rename it footIkControl.
Create a null transform by clicking Ctrl+g with nothing selected.
Next, point-snap the null to the legIkHandle using the v key, as before.
Now you will give this null transform the same orientation and transform
axis as the Dog_right_backLegAnkle joint.
Select the null transform first, and then add to the selection Dog_right_backLegAnkle
by holding the Shift key and clicking it (it needs to be last in the
selection). Hit the p key to perform the parent operation. Next, perform
the menu command Modify, Freeze Transformations. This zeroes out the
transforms of the null and puts them into the space of the ankle joint
(see Figure 17.9).
Clicking Modify, Freeze Transformations zeroes out the transforms
of the null and puts them into the space of the ankle joint.
Now unparent this null joint back to the world level by selecting
it and clicking the menu command Edit, Unparent.
Select and parent the footIkControl locator to the null transform
node. Freeze the footIkControl node's transformations. It now has
the same orientation as the ankle joint.
Next, select footIkControl and use the Shift key to add legIkHandle
to the end of the selection list. Click Constrain, Point, select footIkControl
and Dog_right_backLegAnkle, in that order, and click Constrain, Orient.
You have just point-constrained the IK handle to this locator. You've
also orient-constrained the foot so that rotating it rotates the foot
and translating it moves the IK for the leg.
You are just about finished with the setup for the leg. One last
step is to add a pole vector constraint.
Create a locator, and name it leg_poleVector. Now move it behind
the back of the character's leg, on the side opposite the side of
the leg that bends inward.
Next, select the leg_poleVector locator and legIkHandle, in that
order, and click Constrain, Pole Vector.
Now just group the leg_poleVector locator all by itself (to add an
additional transform above), and then point-constrain the group node
to the Dog_HipsJoint node. Select this new group along with the remaining
IK handles in the Hypergraph, as well as the null transform that is
a parent of your foot control; group them together using Ctrl+g. Name
the new group IkLegControls (see Figure 17.10).
The new group, IkLegControls.
Repeat the previous steps for each of the other legs. This step-by-step
process should go quite quickly when you get the hang of it.
When you are finished with all four legs, add prefix hierarchy names
for each leg by selecting each node together for a single leg, clicking
Modify, Prefix Hierarchy Names, and adding the prefix for that particular
leg (for example, frontRightLeg_ and backRightLeg_).
Next, select all four of your legs' IkLegControls groups, group them
together using Ctrl+g, and rename that group Leg_Controls.
Finally, group together the Leg_Controls and Dog_Root joint under
a new group, and call it DogMainTransform (see Figure 17.11).
The finished legs set up for the dog.
The finished file with all the legs rigged is named Dog_LegsSetup_Finished.mb
on the CD.