- Setting Up a Character for Animation
- Creating Clean Joint Hierarchies for Animation
- Rigging a Simple Quadruped Character: The Dog
- Creating Advanced Bipedal Character Controls
- Advanced Stretchy IK Legs and Classic Reverse Foot
- Advanced IK Arms and Clavicular Triangle
- Hooking Up the Head Skeletal Hierarchy
- The Hair of the Jerk
- Summary
Rigging a Simple Quadruped Character: The Dog
This section covers some simple techniques that you can use to quickly rig a quadruped character for animation, without having to add complex time-consuming or difficult-to-understand controls. Several advanced character setup tutorials later in this chapter go into much more detail on advanced character rigging. The techniques in this section can be used to quickly and easily get a quadruped character set up and ready for character animation.
For many characters, a simple setup is all you will need. As a general rule, it is best to keep your rigs as light and simple as possible so that they are easy to use and maintain throughout the duration of the animated piece. For hero characters whose animation might be the centerpiece of much of the shot or sequence, complex character controls could be necessary. It is the responsibility of the character setup TD to assess with the animators and supervisors of the scene what level of complexity the character's rig should have based on the complexity of the character's motion requirements.
Quadruped Spine and Hips Setup
Here we have built a simple FK spine that can be animated in a very straightforward and traditional fashion by rotating the joints.
As you can see in Figure 17.6, the spine is composed of only six joints, which are pretty much ready to have animation controls hooked up for them.
Figure 17.6 The spine is composed of only six joints .
The important part to notice in this portion of the setup is not really the spine itself, but the way the joints that create the spine are parents of the legs. The portion of the character's joints that starts the legs has an extra joint between the parent leg joint and the spine joint it is connected to. In the back of the character, this joint controls extra rotations of the hips. In the front, it controls extra rotations of the chest. Figure 17.7 shows how your spine hierarchy should connect to your legs using the extra hip joint between the hierarchies.
Figure 17.7 The spine hierarchy should connect to the legs using the extra hip joint between the hierarchies .
These joints are parented in this way so that the additional rotation control can hook IK onto all the legs and still rotate the character's hips independently. This concept of having additional parents in a hierarchy will undoubtedly come up many more times when it comes to rigging a character, so be sure to take note.
Quadruped IK Legs and Feet
The legs of the character are composed of four joints, stemming from the hips and the chest. The foot is a single joint that allows for rotation from the ankle (see Figure 17.8). A relatively simple foot control was chosen because our dog character will not need to have individual control over each toe and claw separately.
To make the IK controls for the legs, we created two IK handles for a single leg and hooked up a locator as a constraint to control the rotation of the ankle as well as the position of the IK handle for the foot. Follow along with this step-by-step exercise to see how we set up the first leg (the back right leg). You can quickly and easily set up the character's other three legs using the same technique outlined here.
Figure 17.8 The legs of the character are composed of four joints, while the foot is a single joint that allows for rotation from the ankle .
Exercise 17.1 Creating Spot's Hind Right Leg
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.
-
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).
-
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.
-
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).
-
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 file with all the legs rigged is named Dog_LegsSetup_Finished.mb on the CD.
Now you will give this null transform the same orientation and transform axis as the Dog_right_backLegAnkle joint .
Figure 17.9 Clicking Modify, Freeze Transformations zeroes out the transforms of the null and puts them into the space of the ankle joint .
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 .
Figure 17.10 The new group, IkLegControls .
Figure 17.11 The finished legs set up for the dog .
IK Spline Tail and Ears Setup
The technique used for the IK spline tail and ears setup is a very common combination of IK splines, with some added FK-style control. The technique you will use in the next exercise is basically to create a spline IK for the entire hierarchy of joints and then draw a low-res joint hierarchy right on top of where the IK spline curve was created (usually two to three joints is enough). Next, you'll simply smooth-bind the low-res joints to the IK spline curve. This is a nice way to get some FK feeling control and still have the ability to translate the joints for IK spline-style results.
Exercise 17.2 Character Setup for Spot's Tail and Ears
This exercise again is performed only on the tail. The exact same technique should then be used on the ears as well.
-
Start with the completed file from the last exercise, Dog_LegsSetup_Finished.mb, which you can find on the accompanying CD.
-
Go to the IK Spline tool by clicking the menu item Skeleton, IK Spline Handle Tool, Options Box. Hit the Reset Tool button at the bottom, and then be sure to uncheck the Auto Simplify Curve and Auto Parent Curve options.
-
Draw an IK Spline curve from the root of the hierarchy, all the way to the last joint in the hierarchy. In this case, it is a nine-joint tail; you create the spline handle starting from the Dog_tail_1 joint and ending at the Dog_tail_9 joint.
-
Next, using the Joint tool and holding down the c key to enter Curve Snap mode, draw a low-res four-joint hierarchy directly on top of the spline curve that was just autocreated by the IK spline tool.
-
Translate the new hierarchy upward just enough that it is not right on top of the other joint hierarchy, and rename each joint in the hierarchy TailControlJoint (see Figure 17.12).
-
Next, select the highest parent of the TailControlJoint hierarchy and Shift+select the NURBS curve that was created automatically by the IK spline tool. You might have to use the Hypergraph to select this curve because the joints are in the way.
-
With the current selection, click Skin, Bind Skin, Smooth Bind using the default options.
-
Select the root of the new low-res control hierarchy and parent it to the node that you want to rotate the real tail hierarchy that has the IK spline solver attached to it. In this case, I parented the new TailControlJoint hierarchy to the Dog_HipsJoint node so that when you rotate the hips, the tail wags along with them.
-
Perform these steps for both the ears. The steps are exactly the same.
-
When you are finished, group any ungrouped spline IK handles as well as spline IK curves under a new group node. Then put this group node somewhere in the character's hierarchy that will not have animation applied to it. In this case, I added a new group node to DogMainTransform and called it Dog_character. This group parents anything related to the character that should not be animated as a child of it.
-
Be sure to lock the translates, rotates, and scales of the Dog_character group node. Parent all the leftover IK controls and NURBS curves under the Dog_character group node.
Figure 17.12 Creating a low-res control hierarchy .
You can find the completed setup in the file Dog_TailAndEarSetup_Finished.mb on the accompanying CD.
Low-Res Stand-In Geometry
As the following exercise shows, creating stand-in geometry is a very simple process. This geometry is simply a low-resolution version of the actual character geometry, which is then cut up into a separate piece per joint using a combination of the Cut Poly Faces tool and the Poly Separate command. The cut polygon pieces are then simply made a child of the joint that they correspond to. Now, the low-res geometry moves with the joint hierarchy but is not bound or deforming, so it is extremely fast and interactive for the animator to use.
Exercise 17.3 Creating Low-Res Stand-In Geometry
For this exercise, you begin with the finished file from the previous exercise, Dog_TailAndEarSetup_Finished.mb, which you can find on the accompanying CD.
-
Import into the Dog_TailAndEarSetup_Finished.mb file the low-res dog file, called Dog_lowResPolyStandIn.mb, which you'll find on the accompanying CD (see Figure 17.13).
-
Take a look at the joint hierarchy of the dog, and start to figure out where you want to cut your low-res poly object into separate pieces. A general rule is that you will need to cut your character in any place that it will need to bend, or any child that will need to rotate independently from its parent to achieve the articulation of the character's pose.
-
Select the low-res polygon character. Activate the Cut Poly Faces tool by clicking Edit Polygons, Cut Faces Tool (it might say just Cut Faces, depending on your tool settings) Option Box (see Figure 17.14).
-
Now, with the options from the previous figure, drag your mouse across the geometry and watch as the Cut Faces tool creates a straight line across your geometry. This is where the polygons will be cut when you release the tool. Cut the polygons. Experiment with where you are cutting the geometry and how well it lines up with the location of the joint.
-
Next, after you have cut the polygon, perform the menu commands Edit Polygons, Separate and then Edit, Delete by Type, History.
-
Cut the geometry into a separate piece for each joint, trying not to cut across other parts of the geometry that shouldn't be split yet. Then, each time you cut, separate the polygons and delete the history. Eventually, you will be finished cutting up the entire geometry.
-
Next, one by one, select each polygon piece that you cut, and Shift+select the closest joint that you cut that piece for. Hit the p key on your keyboard to parent the geometry to the joint. Do this for each separate piece that you cut for the character.
Figure 17.13 A low-res version of the character model is used for the low-res stand-in geometry .
Figure 17.14 Select the low-res polygon character, and activate the Cut Poly Faces tool .
You can find the finished file with the low-resolution stand-in character properly cut and parented in the file Dog_LowResStandIn_Finished.mb on the accompanying CD.
Hooking Up Control Boxes to Your Character Rig
Control boxes are the visual handles that the character animator uses to animate the character. The control boxes are an extra layer of setup hooked up to your skeleton's joints, IK, and hierarchical controls to give the animator a simple and intuitive way to see and select all the controls for your character that are meant to be animated. All the translation and rotation of your character should happen on character control boxes, not on random locators or selection handles that are difficult to see or select.
Control boxes can be made of NURBS curves or of polygon objects that have been disconnected from a shader. NURBS curves are the most common choice because you can isolate them for selection while animating using the NURBS Curve option in the Object Mode Pick Mask menu. You can also quickly view them on or off with the Show NURBS Curve option of the Show menu of your current 3D view port window (or from the HotBox).
Open the file CharacterControlBox.mb on the accompanying CD to see exactly what a control box is. As you can see, it is just a NURBS curve that has been shaped so that it creates a cubelike box shapehence the name control box (see Figure 17.15). Control boxes can, of course, be any shape and size (because they are just NURBS curves), and the CVs of the curve itself can always be hand-tweaked to produce the correct shape.
Figure 17.15 A control box .
You can hook up a control box to a rigged character in several ways. Basically, the main goal is to in some way connect the transformation controls of the control box into the transformation controls of the character rig. You can achieve this through expressions, complex node networks, or just simple constraints or parenting relationships.
The most common and straightforward methods for hooking up control boxes to your character are the following:
-
Transform (object) parentingSimply parent your control as a child of your control box. This works easily and efficiently for things such as IK handles and constrained locators, as well as groups that are meant to control translation or rotation.
-
Shape parentingYou do this by parenting the NURBS curves' shape nodes (not the transform, but the shape, which you have to load into the Hypergraph and graph input and output connections to see and select). Making the NURBS curve shape a child of the actual transform that you are trying to hook up the control box for enables you to use the curve as a selection handle for the actual joint or hierarchical animation control.
You can do this by first point-snapping the NURBS curve to the joint that you want to hook it onto. Next, parent the NURBS curve transform to the joint and click Modify, Freeze Transformations on the NURBS curve. Select the NURBS curve shape. (Make sure the node says Shape at the end, in Hypergraph, Graph, Input and Output Connections. Also be sure you have the shape selected, not the transform.) Then Shift+select to add to the current selection the joint (or any other transform node) that you want to hook up the NURBS curve as a selection handle for. Then perform this MEL command:
parent Ðr Ðshape;
This parents the NURBS curve shape node under the transform for the joint. Now you should be able to select the curve in the view port window, but in actuality you are selecting the transform of the object that you just parented the NURBS curve shape onto .
Grouped control boxes with constraintsCreate a group node that has the same orientation and translation space as the joint or node that you are hooking up the control box. Then make this node the parent of your control box. You then freeze transforms on the control box and point-constrain it to the joint that you are hooking up to. Orient-constrain the joint to the control box so that it controls the rotations.
You can create a group node that has the same orientation and translation space as the joint or node that you are hooking up the control box to in two different ways. First, you can create a null transform by selecting nothing and then hitting Ctrl+g. Next, you can give the null the same transform pivots as the joint or node you are trying to hook up to. You do that in two ways:
Point-, orient-, and scale-constrain the null transform node to the joint. Then immediately delete the constraint nodes to give the null transform node the same transform space as the joint.
Point-snap the null transform node directly on top of the joint. Then temporarily parent the null to the joint, freeze transforms on the null, and unparent it back into its original hierarchy to give the null transform node the same transform space as the joint.
Grouped control boxes with direct connectionsCreate a null group node, and point- and orient-constrain it to the parent node of the actual joint or transform that you are trying to hook the control box onto. Next, create a group node that has the same orientation and translation space as the joint or node that you are hooking the control box up to; make this node the parent of your control box. Parent your control box group node under the constrained null. Then freeze transforms on the control box and open the Connection Editor. Load the NURBS curve's rotates on the left side and the joint's rotates on the right, and directly connect them to one another so that the control box is driving the rotations of the joint. Even though they are directly connected, they will always move together properly because the parents are linked with constraints and the nodes are both in the same transform space.
Connecting your control boxes is really a crucial element of rigging your character because it is one of the last steps before your character is ready for animation testing. treat the process of hooking them up to your character accordingly. One thing to remember, though, is that it really doesn't matter how you get your control boxes hooked up to control your character, as long they work correctly and move the correct nodes around. Sometimes on simple characters you can get away with purely parenting techniques or direct connections alone (which is perfectly acceptable). Another good idea when it comes to hooking up your control boxes is to keep the translates and rotates of the control boxes transforms capable of going back to zero as the default attribute state. Therefore, if you need to move, scale, or position your control box, simply enter Component mode and shape it using the control vertices. This also usually means freezing the transforms before actually going through the process of connecting the box to control a joint or other transform node.
Also remember that control boxes are simply used to select animation controls for your character and to move the character around. The goal of these controls is that they be immediately accessible and selectable from any view. Sometimes it is difficult, but do whatever you can to make the controls easy to see and select from most angles. This includes making controls somewhat uneven in shape or asymmetrical, as well as color-coding so that if one is right on top of the other, it is still quite intuitive to differentiate between the two control boxes.
Here are a few easy ways to color-code your control boxes in Maya:
-
By clicking Display, Wireframe Color with the object selected, you can easily change the color of just about any object without modifying attributes that other parts of Maya directly use to change the color of the node as well (such as the Layer Editor).
-
Open the Attribute Editor of the node and expand the Object Display frame layout. Then expand the Display Overrides subsection of the Object Display layout. Next, turn on the check box that reads Enable Overrides. Now the lower section that reads Color becomes enabled, and you can drag the slider and choose any color that you want.
-
Simply make a layer and assign your objects to that layer. Then just change the layer color. This is the least preferred method because you really don't want to have to make a layer for every single object whose wireframe color you want to change.
NOTE
Changing the wireframe display color affects only the OpenGL display of the node, not any look or color attributes of the shader or the software-rendered elements. However, it affects the "hardware"-rendered wireframe color.
Figures 17.16 and 17.17 show the control boxes for The Jerk and Spot models, respectively.
Figure 17.16 The control boxes for The Jerk. Figure 17.17 The control boxes for