CHAPTER 8

image

Character Rigging and Skinning

 

 

We’ve traveled a long way. We’ve created geometry, UVed that geometry, created materials to make the geometry look like it is a variety of materials, and even lit it to give it extra form and depth. All of this is important — and without it we can’t get to what’s next: animation.

At the end of the day, animation is what brings this digital world to life. Whether it’s in games, TV, or movies, the most lucrative part of 3D that has the broadest appeal is the animation. The last two chapters of this book are devoted to this pursuit. This chapter will be focused on creating the puppet or the controls to allow for animation, while Chapter 9 will actually be involved with making things move.

Turns out, any object can move in Maya. Any object can have keyframes set, and the scale, position, or rotation change over time. But the most dynamic animation happens when a character moves, specifically when a single mesh (like the alien) deforms to give the illusion of muscles and bones giving the shape form and moving it in space.

Maya is probably not the best modeler out there. It isn’t even my favorite for creating materials. Its lighting tools are limited by its rendering engine. But in animation, it is really among the industry leaders, particularly in character animation. Although there are certainly other packages in this space (SoftImage for one), when talking to character animators, chances are they using Maya to bring their characters to life.

Deformation Objects and Joints

Part of the reason for this is Maya’s robust and reliable collections of deformation objects. Deformation objects are tools that deform a collection of geometry. Of particular interest to us is the joint.

In anatomical terms, think of joints as the point where two bones meet. This was originally a fairly new way to think of character deformation objects. Most 3D software created bones. But Maya creates joints: it focuses on the point of movement. When multiple joints are strung together (one as a child of the next), Maya creates a visual representation of this connection as a bone; but the focus is still on the joints.

What happens is that joints are given an influence over vertices near them, and as the joint rotates, it deforms the vertices it has influence over. This process of defining which vertices are manipulated by which joints is called skinning. Creating the joints themselves and building handles to manipulate those joints is referred to as rigging. Both are critical of course, but they are really separate processes. In this chapter, we will work with both. First, we will create the skeleton for the character and will then rig it with some basic handles that will allow us to manipulate the joints easier. Once this is done, we will skin the character to make the joints deform the mesh in a believable and pleasing way.

Joint Behavior

Joints and the way they interact with polygons have some specific peculiarities that are important to understand. Consider the following mini-tutorial to get a better idea of how it all works:

Step 1: In Maya, create a new file.

Step 2: Maximize one of the orthographic View Panels (move the mouse over top, side, or front and hit the space bar).

Step 3: Activate the Joint Tool (Animation|Skeleton > Joint Tool).

Step 4: Click and release anywhere in the View Panel to create a joint (Fig. 8.1, left).

Step 5: Click again a couple of times in a couple of different places to create new joints as part of a joint chain (Fig. 8.1, center).

image

FIG 8.1 Each click of the joint tool will make a new joint that is the child of the preceding joint. The preceding joint will automatically orient toward the new child.

There are several things to notice about this:

1. When a joint is first created, its orientation is straight up and down — it is oriented standing straight up (the white arrows in Fig. 8.1 indicate the joint’s orientation or the direction the joint is pointing).

2. While still in the Joint Tool, if other joints are created, the joint before the new joint automatically orients to point at this new joint (this is good).

3. When these new joints are created, they are also automatically created as children of the joint before it (Fig. 8.1, right).

4. Generally — although not always — creating joints is best done in non-perspective views (top, front, or side). It just makes sure that this auto-orienting happens predictably.

5. When creating joints with the Joint Tool, when you click, the joint is created, but if you click drag, you can create and move the joint into place before it is actually placed.

6. When in the Joint Tool, hitting Enter exits you from the tool and ends the joint chain.

7. Maya 2012 seems to have introduced a bug when creating joints in these orthographic views. When in a four-view setup, when creating a joint, the joint isn’t actually painted until the mouse is released. This is an icky bug, but if you maximize the View Panel, the joint appears as soon as you click.

There are some other eccentricities to this tool that we’ll be talking about in the coming tutorials, but if you understand these basic ideas, we can get things going.

Joints as a Deformation Object

Joints, by themselves, are pretty useless. If they don’t have any geometry to deform, they don’t even show up in a render. What this means is that a joint’s efficacy is heavily tied to the geometry it is deforming. Consider the following example: Fig. 8.2 shows a simple joint chain (e.g., a basic finger). The left most image is the joint chain alone. The middle image is the joint chain tied to a cylinder that is one subdivision tall (one ring of vertical polygons goes from the bottom of the cylinder to the top). The right most image is the same structure, but tied to a cylinder with many subdivisions along its height.

image

FIG 8.2 Joints and how they deform differing topology.

Remember that polygons don’t bend. The only way a mesh deforms is along the vertices or edges where polygons meet. In the center image, there simply aren’t any places for the shape to bend — the unyielding polygons go from bottom to top. On the other hand, the shape on the right side has loads of places to bend, and therefore, the joints are able to affect a new form.

Sometimes, this means that when creating joints, you may notice that you don’t have enough places for your mesh to deform. If this is the case, you’ll need to insert some additional geometry (perhaps through something like the Insert Edge Loop Tool). Generally, the alien’s topology is in good shape; but in your own creation, always keep this in mind.

Tutorial 8.1 Joint Chain for the Alien

This alien was modeled as a game model. This means that the polygon count was an important part of the design and construction. However, if you take a look at the model provided on the support website, you’ll notice that around the elbows and knees (for example), there are rings of polygons that allow for good deformation.

As you follow this tutorial, take a look before you get too far to see if you need to add additional geometry to the areas where a joint is going to be deforming the mesh. If you’d like, you may want to use the version provided on the website — although your own version would be great as well.

Step 1: Set your project and open the alien character.

Step 2: Position the character, so that it sits on the floor. The easiest way to do this is to first move the axis of the character to the bottom of his boots (hold d and v down together to move the axis and snap it to a vertex). Next, hold x down (to snap to grid) and move the character up, so that his feet are sitting on the ground grid.

Why?

This is largely cosmetic. It just becomes easier to see how everything fits together when the character is standing on the ground. It’s unlikely that he was modeled standing on the ground. Also, later, when bringing this character into a game engine, this can help head off some other issues in character placement.

Step 3: Clean up the history and transformations. Do this by first choosing Edit > Delete All by Type > History. Then, select the body of the alien and choose Modify > Freeze Transformations. Repeat this for the eyes.

Why?

This is not cosmetic. It’s pretty important to actually have a mesh that is devoid of all history when getting ready to do any rigging or skinning. Deforming a mesh can be a processor intensive procedure, and if there is other history on the mesh, Maya has to recalculate all those history nodes for every tweak to a skinned joint. Having a straight chunk of geometry cuts way down on the amount of calculations Maya has to do and helps to stave off unintended hiccups along the way.

Root Joint

Ultimately, we need to have a skeleton in which all the joints are connected. Importantly, there need to be one joint that is the ruler of them all. We will call this master joint the Root joint. Generally, the theory here is to have the Root joint be at the center of weight for a character — which is generally about halfway between the belly button and the bottom of the crotch.

It will be important that this Root joint has a very clean orientation — that it isn’t oriented toward any particular joint and is set to be rotated at 0, 0, 0 in the world space. To do this, we need to place a joint and then exit the Joint Tool.

Step 4: In the side View Panel, place a joint and exit the Joint Tool. Remember to activate the Joint Tool and go to Animation|Skeleton > Joint Tool. Place a joint by clicking. Exit the tool by hitting the Enter key (Fig. 8.3). In the Outliner, rename the joint to Root.

image

FIG 8.3 Placing the Root joint.

Why?

Placing this joint in the side View Panel does some things for us. This character is largely symmetrical, and so, we will only need to create one-half of the character’s joints and then mirror those joints. By placing joints (like the Root joint — that will be right in the middle of the character) in the side View Panel, we know that it is sitting at X = 0 — in the middle of the character.

Legs

Later, to animate the legs, we will be using a method called inverse kinematics (IK). We’ll talk much more about what this means later — but for now, it’s important that we create the legs, so that each of the joints are at an angle (don’t create them in a straight line).

Step 5: Still in the side View Panel, create five joints for the hip, knee, ankle, ball, and toe (Fig. 8.4). This time when using the Joint Tool, simply click and release for the placement of each joint and hit the Enter key after creating the last joint (the toe; Fig. 8.4). Label them as L_Hip, L_Knee, L_Ankle, L_Ball, and L_Toe.

image

FIG 8.4 Creating the leg joints.

Why?

Special note that the knee is bent. If the hip, knee, and ankle are all in a straight vertical line, there will be real problems later when we set up the IK rig. For the hip, knee, and ankle joints, the idea is to place the joints in the middle of the leg or where the actual physical joint would be on a real person. However, for the ball and toe, we are placing the joint where the ball and toe of the foot actually would touch the ground.

The naming here is important. “L_” of course stands for “left.” If we effectively name one side of the skeleton we are creating, when we mirror it later, Maya will do some quick and effective renaming for us that will include replacing all the L_ with R_.

Also, notice that if you look at any of the other views, this new joint chain is going to look really strange, as it will appear to come out of the bottom of the character’s crotch. Not to worry, we’ll fix that in a minute.

Step 6: Position the leg joints (move only). In the front View Panel, select the L_Hip joint and use the Move Tool to slide the hip over, so that it sits where it should be for the leg (Fig. 8.5).

image

FIG 8.5 Moving the leg joints.

Step 7: Rotate the leg joints. First, select L_Hip if it is not selected. Then we want to make a few changes to how the Rotate Tool works: double-click the Rotate Tool, and the Tool Settings window will appear (probably to the left of the interface). Here, under the Rotate Settings area, change the Rotate Mode to World. This will change the rotation handle, so that it is flat in world space instead of rotated as the joint was. Now, rotate the L_Hip joint along the Y axis (grab only the green circle of the handle) and rotate the chain, so that it is set within the leg. This is most easily done from the persp View Panel (Fig. 8.6).

image

FIG 8.6 Rotating the leg appropriately.

Why?

There’s a lot going on here. We haven’t messed with the Tool Settings much; but as you can see, it allows us to determine from what axis we are rotating things from (local, which is the default, or global, which is what we’re doing here). The Move Tool by default is moving objects in global space (no matter how the object is oriented, the manipulator handles still match the global coordinates). However, by default, the Rotate Tool rotates its handles to match the rotation of the selected object. In this case, it would be a complex collection of rotations to get the leg rotated right if the handles were rotated to match the rotation of the L_Hip joint. By swapping the way the Rotate Tool works, we can quickly get it oriented in the appropriate direction.

Step 8: Reset the Rotation Tool by clicking the Reset Tool button in the Tool Settings window.

Step 9: Adjust the L_Toe joint to reach the end of the toe. First, select the L_Toe joint. To move this toe and keep it in line with the ball, we’ll adjust how the Move Tool works as well: double-click the Move Tool to open the Tool Settings windows. In the Move Settings section, change the Move Axis to Local. This will rotate the Move Tool handle, so that it is rotated as the joint chain is. Move the joint along the X axis, so that it sits right where the toe of the boot touches the ground (Fig. 8.7).

image

FIG 8.7 Using the altered Move Tool to move the L_Toe joint, so that it matches where the toe touches the ground.

Why?

When we first made the leg joints, we were doing it in the orthographic side view. This would have worked fine if the character toes were facing straight forward, but because this character’s feet are pointed outward, we need to adjust its position slightly to make sure the toe is actually where we planned on it being.

Step 10: Reset the Move Tool by clicking the Reset Tool button in the Tool Settings window.

Step 11: Freeze Transformations for the leg joints. Select L_Hip and choose Modify > Freeze Transformations.

Why?

This will do a couple of important things for us. First, it will make sure that the rotation values for all the leg joints are indeed at 0, 0, 0. Second, it will make sure that the hip joint (which we rotated with the altered Rotate Tool) will orient to point to the knee (this will be important to the IK calculations later). The core idea here is that joints can be moved without a problem; but it’s best to have the rotation values always be 0, 0, 0. This will make it easy to get the characters joints back into place if we start rotating them in animation later.

Step 12: Make the leg joints a child of Root. To do this, in the Outliner, middle-mouse-drag the L_Hip joint onto the Root joint.

Why?

We created this leg chain independently of the root. Making it a child of the root will create a new bone that connects the two and make sure that the leg is indeed a part of the master skeleton for this character.

It’s important to note that we could have created the Root and then just continued down to the leg; but this would have meant that the Root was oriented toward that left leg — and not remained oriented straight. By creating the leg chain, and making it a child of the Root, we keep the rotation of the Root pristine.

 

Tips and Tricks

Note that there is another joint that could be used here that you will read about called a Pelvic Girdle. The Pelvic Girdle is a joint that goes beneath the Root that has two children: each of the hips. This allows for the hips to be moved and animated without affecting the upper body. For high-poly characters built for TV or film, I prefer to have this joint. But for a game character, we want to keep the joint count low (deformation objects are expensive to a game engine), so we will leave it out.

IK vs. FK

Kinematics is the study of motion without regards to force. In animation, kinematics basically refers to “how am I going to control how this thing moves.” Specifically, kinematics generally refers to character joint positioning. There are two ways of positioning joints: Forward Kinematics and Inverse Kinematics.

Forward Kinematics (FK) works by rotating a lot of joints. If a character is reaching up to grab a glass, FK would have the animator rotating the shoulder, then the elbow, and then perhaps the wrist to get the character into position. The nice part of this is that this rotation of joints causes the arm to move in continuous arcs, which is how our bodies move. The bad part is that there ends up being a lot of tweaking to get that arm into the right spot, so that the hand meets the glass.

Inverse Kinematics (IK) works by moving a target and then having Maya to calculate the rotation of a joint chain to allow it to point at that target. This is a more indirect method of rotating joints and can be very useful. In situations like walks, this means that a target could be placed where the foot hits the ground, and then as the character is moved up and down or front and back, the joints in the leg are continually rotating to allow that foot to stay on the ground. The problem with IK is that it can lead to very robotic movement as an animated target takes the most direct path between poses.

So which is better? Well, both of them are. It’s kind of like asking if a hammer or a screw driver is a better tool; it depends on the task at hand. For the upper body, I prefer to pose and animate using FK for things like walks and gestures. It makes much more fluid and believable motion. But for the legs, IK is a more effective tool. It allows for all sorts of quick poses as the body can be moved, but the feet stay planted. Although there may be other preferences on the upper body (some folks like to animate the upper body at times with IK), there is really no debate about the lower body — IK is the way to go.

For us, this means we need to set up IK chains in the leg. We are doing it now, so that we only have to do it once. If the left leg is set up well with complete IK chains, when the left leg joints are mirrored, the IK mechanisms will be mirrored as well.

In the next few steps, we’re going to set up more IK handles than it would seem we need. This is partly to lay the groundwork for a later foot roll rig.

Step 13: Create an IK chain between the L_Hip and L_Ankle. To do this, choose Animation|Skeleton > IK Handle Tool. To use the tool, in a View Panel, click on the L_Hip joint to start the IK chain and then click second time on the L_Ankle joint (Fig. 8.8). Rename the new ikHandle that will appear in the Outliner to L_AnkleIK.

image

FIG 8.8 Creating an IK chain with the IK Handle Tool.

Why?

This will create a bunch of new gizmos on the screen. Notice that there is a new handle down on the ankle (for some fun, use the Move Tool to grab that handle and move it around to see IK in action — but be sure to undo(Cntrl + z) to get it back into position). This is the actual IK handle. Notice that there are other green lines to show how the IK chain is built and which joints are involved in the chain.

Step 14: Create an IK chain between L_Ankle and L_Ball. Again, activate the IK Handle Tool and then click once on the L_Ankle and second time on L_Ball. Rename the new ikHandle to L_BallIK (Fig. 8.9).

image

FIG 8.9 Second IK chain between ankle and ball.

Why?

I know, this seems really strange to have an IK chain between just two joints. What it will eventually allow us to do is change the rotation of the foot. It’s all part of a rig that will allow us to control how the foot rolls.

Step 15: Create one more IK chain between the L_Ball and L_Toe. Rename the ikHandle to L_ToeIK (Fig. 8.10).

image

FIG 8.10 Final IK chain between ball and toe.

Mirror

With the left leg done and labeled correctly, we can use a great tool in Maya to quickly build the other side.

Step 16: Mirror the left leg joints. Do this by selecting the L_Hip joint and then choosing Animation|Skeleton > Mirror Joint (Options). There, change the Mirror across setting to YZ and change Search for: L_ and Replace with: R_ (Fig. 8.11).

image

FIG 8.11 The Mirror Joint Options window.

Why?

The Mirror across option is defining which plane to mirror across — which in this case would be a plane that ran along the Y and Z axis. The Search for/Replace with mechanism is a naming help. It simply looks at each of the joints and associated handles and with the mirrored version, replaces any “L_” with “R_.” The ultimate result will be a complete right leg with all its IK handles intact and everything labeled correctly. I love this tool.

Upper Body

Now that when the lower body’s joints are placed, we can move to the upper body. We have some work left to do in the lower body — especially in regards to handles to control it, but we’ll still get all the joints into place.

Step 17: In the side view, create a spinal column. Do this by creating six joints for Back_Base, Back, Clav_Base, Neck, Head, and an extra joint for the head to point toward (Fig. 8.12).

image

FIG 8.12 Spinal column.

Why?

We build this from the side to make sure that the spine is right in the middle of the body. The number of joints is low for a couple of reasons: First, this is a game character, and too many joints slow down the performance of the game. Second, this is a pretty round and short character, so there will not need to be that much deformation along the back.

The placement of these joints isn’t absolute. Some important things to consider though: the Head joint should be placed where the spinal column would connect to the skull (it’s sometimes a little hard to tell with a character like this where this would be — but in more humanoid characters, this is a critical placement). Neck should be at the base of the neck. Clav_Base will be the joint we build the clavicle bones (collar bones) from, so it needs to be up where the arms will branch.

Step 18: Delete the last joint on the top of the head.

Why?

This joint is really there to make sure that the Head joint (down by the base of the skull) is oriented correctly. However, it won’t actually affect any vertices, so ditch it.

Arms

Creating the arms can sometimes be a little tricky if the character isn’t modeled in a true T-pose (arms straight out to the side). There are all sorts of interesting techniques to placing the joints in the arms. One of my old students taught some adjunct classes for us and demonstrated a great technique in which he ripped the polygons of the arm off the body, rotated them straight to build the joints, and then rotated that arm chain into place. For us, we will be exploring a few other functions of the Joint Tool to get the character’s arms into place.

Of particular interest to us is that the Joint Tool allows already created joints to be positioned by middle-mouse-dragging them. This means that a joint can be placed in one View Panel by clicking and releasing, and then in another View Panel, the joint can be moved into a better position by middle-mouse-dragging it. This means you needn’t exit the Joint Tool, and it keeps the joints auto-orienting to the next joint’s position.

The next important idea is that the Joint Tool will allow new joint chains to be built off of extant joints. To do this, you just need to select the Joint Tool and make the first click on a joint that already exists. Click after that build new joints as children of the first clicked joint.

Step 19: Create and position the L_Clav joint. Start this in the front View Panel by activating the Joint Tool and first clicking on the Clav_Base joint. Then click where the L_Clav joint should be (Fig. 8.13). Do NOT hit Enter or otherwise select another tool.

image

FIG 8.13 L_Clav placement in the front View Panel (we still need to adjust its position in other View Panels).

Step 20: While still in the Joint Tool, adjust the position of this new L_Clav in the side View Panel. Swap to the side View Panel, and middle-mouse-drag the joint (Fig. 8.14).

Step 21: Create the L_Shoulder, L_Elbow, and L_Wrist joints using the same technique. This means starting in the front View Panel by placing the joint, but using the side View Panel to middle-mouse-drag the joint into place (Fig. 8.15). Note, we are still in the Joint Tool.

image

FIG 8.14 Middle-mouse-dragging a joint to position it better while still in the Joint Tool.

image

FIG 8.15 Shoulder, elbow, and wrist.

Tips and Tricks

Sometimes even adjusting in the persp is a challenge. But in this View Panel (or any of them), it can sometimes be tough to see what all is happening in wireframe. Try hitting 5 on the keyboard to get a solid form, and then in a View Panel, choose Shading > X-Ray Joints. This will make the joints always visible as they will draw on top.

Hand

Amazingly at this point, we should still be in the Joint Tool (never exited since we started creating the L_Clav). Here, we can keep creating the joints for the hand.

Step 22: Create joints down the hand through the alien’s pointer finger. Be sure to be adjusting in all the views to get them into the appropriate position (Fig. 8.16). Finally, now hit Enter to exit the Joint Tool.

image

FIG 8.16 Continuing down the hand to the end of one finger.

Why?

We’re extending down this finger simply because it’s the one that is closest to a straight line from the wrist. In other characters — a five-fingered character for instance — the middle finger (birdie) might be a more appropriate one to use.

 

Tips and Tricks

Again, this is a game character, so we are making a very simplified rig. A high-poly rig might include joints for things like forearm twist, metacarpal joints to allow for a more realistic deformation of the palm of the hand. However, for this character, we are going to have fingers with one less joint than usual and very simplified arm and hand chains.

Step 23: Create the other finger joint chains by building joints off of the L_Wrist joint. Remember to build a chain off an existing joint, just activate the Joint Tool and make sure the first click is on an extant joint (Fig. 8.17).

image

FIG 8.17 Complete hand joints.

Step 24: Take a moment to name all the joints. Be sure that all these start with a L_ prefix. The exact names are unimportant.

Orienting Joints

The orientation of joints actually becomes a pretty important issue when it comes to animating. If a joint — the elbow for example — is oriented straight up and down, instead of along a line that goes from the shoulder to the wrist, when it is animated, it will have to turn along all three axes instead of one to bend correctly. In a simple pose, this might not be so bad, but the math is a lot more complex as Maya attempts to go from key pose to key pose and problems abound. Being able to rotate a joint just along the axis that it should rotate along (like the elbow, knee, and fingers do) will solve lots of problems. There are some automatic tools that help make sure that the joints are indeed oriented appropriately, but first we can do a little bit of adjustment.

As the joints were placed, you likely made your best guess as to where the joints should be. And these guesses often seem to make great sense right when the joint was placed, but when you got back and look at the joints — particularly in persp View Panel (where you can really rotate around a joint and see where it is within the mesh) — sometimes it becomes clear that things aren’t quite right.

No sweat. At this point, it’s not too late to adjust this. There are some things that are important to remember. First, move the joints into a better place — do not rotate them. By moving the joints, the joints above will automatically orient to point at this new location (which is good). More importantly, as these joints auto-orient, their Rotation values remain 0, 0, 0, which will come in really handy when it comes time to get the character back into a neutral position.

Step 25: Examine joints and move them into better locations if needed. Remember to only use the Move Tool to do this — do not rotate them. Step 26: Select the L_Clav joint and choose Animation|Skeleton > Orient Joint.

Why?

The changes here will be very, very slight, so you’ll have to watch closely to see them. What will likely happen is a slight twitch of the joints indicating that they have altered orientation to be pointing to the next joint. If you make any moves to any of the joints, firing this Orient Joint can help to ensure that the joints are indeed oriented correctly.

Cleaning Up

Step 27: Select the joints on the end of each of the fingers and delete them (the joints to delete are shown in Fig. 8.18).

image

FIG 8.18 Delete these joints.

Why?

If we were going to delete them, why create them in the first place? Well, these fingertip joints give the joints above them a place to point at, so that their orientation is correct. However, these joints won’t actually influence any geometry (the joint above them will actually be controlling the fingertip geometry), so there’s no reason to have them cluttering up the data set.

Step 28: Mirror the L_Clav joint chain. Do this by selecting L_Clav and then choosing Animation|Skeleton > Mirror Joint. The settings from last time we used this command should still be in effect. The results will be a completed skeleton.

Step 29: Make Back_Base a child of Root. Remember to do this, in the Outliner, middle-mouse-drag Back_Base onto Root.

Foot Roll Rig

Animating the foot can be trickier than it would seem. When we walk, the mechanics of the foot comes so automatically that it seems strange that it would be hard at all; but the mechanics of how our foot comes off the ground, how it is posed as it travels through the air, and how it hits the ground are all very specific. Setting up a rig that allows for an easily controllable foot will make animating the character much, much easier.

To do this, we’re going to create some handles that allow for us to control the IK handles. We’re also going to make use of some techniques that protect the transform values (Position, Rotation, and Scale) of a handle, so that it stays clean (0, 0, 0).

Step 30: Make the IK handles sticky. Select any of the IK handles (for instance the L_ToeIK) in the Outliner, and in the Attribute Editor, look for the tab that has the name of the IK handle on it (L_ToeIK in this case). Expand the IK Handle Attributes Section and change the Stickiness to Sticky. Repeat for all the other IK handles.

Why?

Every time when I show this in class, there is a great deal of snickering. “Sticky” and “Stickiness” hardly seem like technical terms, but they are actually quite descriptive. What this will do is make sure that the IK handle sticks to its place in space. It means that if the Root is moved, the feet will stay stuck in place.

Step 31: Create a NURBS circle handle. Do this by first turning off Interactive Creation (Create > NURBS Primitives > Interactive Creation). Then, create a new NURBS Circle via Create > NURBS Primitives > Circle (Options). Here, change the Normal Axis to X and hit Create. Rename the new circle to L_Toe_Cntrl. The results will be a circle that’s standing up at 0, 0, 0 in world space (Fig. 8.19).

image

FIG 8.19 L_Toe_Cntrl on creation.

Why?

Turning off Interactive Creation means that the circle is created right where we can see it and importantly has Translate X, Y, and Z values of 0. Changing the Normal Axis to X means that it is rotated vertically but still has Rotate X, Y, and Z values of 0. If you want to scale it, go ahead, but be sure to choose Modify > Freeze Transformations if you do, so that you also have Scale X, Y, and Z values of 0. We are working hard here to create a handle that has “clean” transforms.

Step 32: Select L_Toe_Cntrl and group it to itself. Do this by either hitting Cntrl-g or choosing Edit > Group. Rename this new group as L_Toe_Cntrl_Group.

Why?

Weird, huh? Grouping the handle to itself? The idea here is that we are really making the curve a child of a null object. This parent null object will absorb all the dirty transform data (we can rotate it, scale it, move it, etc.) and make sure that the circle itself retains its clean transform data.

Step 33: Snap the L_Toe_Cntrl_Group to the L_Toe joint. Do this by first making sure the group is selected by selecting it in the Outliner. Then in the View Panel, change to the Move Tool and holding the v key down (snapping to vertex), move the group (which will take the circle with it) to the L_Toe joint (Fig. 8.20).

image

FIG 8.20 L_Toe_Cntrl_Group snapped to the L_Toe joint.

Step 34: Orient Constrain the group to the toe. In the Outliner, select the L_Toe joint, and then hold Cntrl down (command on a mac) and also select L_Toe_Cntrl_Group. Choose Animation|Constrain > Orient (Fig. 8.21).

image

FIG 8.21 L_Toe_Cntrl_Group orient constrained to L_Toe joint.

Warnings and Pitfalls

It can be a little tricky keeping track of whether you are working with the group that contains the circle or the actual circle itself as selecting either looks the same in the View Panel. However, it is critical that you know which you have selected. It’s the reason why selecting in the Outliner for this sort of thing is preferable as you can see specifically which you have selected. In this case, it must be the group and not the curve.

 

Why?

Constraints are really tools that tie together certain attributes. An Orient Constraint ties the rotation values of objects. By setting up this Orient Constraint, the L_Toe_Cntrl_Group has matched the rotation of the L_Toe joint.

Importantly, what this does is make the group’s orientation match the rotation of the joint and so it has “dirty” transforms (the rotate values are non-zero). However, if you select the circle itself (L_Toe_Cntrl), you’ll see that it still has clean (0, 0, 0) values for its Rotate values.

Step 35: Delete the L_Toe_Cntrl_Group_orientConstraint1 node. Do this in the Outliner by just selecting this node with the “!” symbol and hitting Backspace or Delete on the keyboard.

Why?

The Orient Constraint constantly checks the rotation of the source and passes that value onto the target. We don’t want this to be continually done at this point — we just wanted to make sure the group was appropriately oriented to begin with. Deleting the node tells Maya to stop worrying about passing values every frame between the joint and the group.

Step 36: Repeat this process for L_Ball. The results will be a L_Ball_Cntrl circle inside a L_Ball_Cntrl_Group that is snapped to the L_Ball joint. This group should be oriented to match the L_Ball joint with the Orient Constraint node deleted.

Step 37: Create a new NURBS circle handle named L_Heel_Cntrl. Group it to itself — name the group L_Heel_Cntrl_Group, and then snap that group to the heel of the character (this is the geometry where the heel of the boot would touch the ground (Fig. 8.22).

image

FIG 8.22 L_Heel_Cntrl_Group and L_Heel_Cntrl_Group snapped to heel.

Why?

The core idea behind these handles is that they indicate the axis that the foot will rotate around. These axes happen to be places where the foot makes contact with the ground. For the toe and ball, the joint happens to be in this spot, but for the heel, we need to use the geometry to snap the handle as we want to rotate around the heel — and not the ankle.

The Power of Hierarchy

The next few steps are all about making objects children of others. By making an IK handle, a child of one of our circle handles, it shifts that IK handles axis of rotation to the rotation of the circle handle.

Step 38: Make L_AnkleIK a child of L_Ball_Cntrl. Do this by middle-mouse dragging L_AnkleIK onto L_Ball_Cntrl.

Why?

When L_Ball_Cntrl rotates, it will control the L_AnkleIK and rotate the heel off the ground.

Step 39: Make L_BallIK, a child of L_Toe_Cntrl.

Step 40: Make L_Ball_Cntrl_Group, a child of L_Toe_Cntrl.

Why?

This means that the IK handles for L_BallIK and L_AnkleIK are both children of the L_Toe_Cntrl. So when the L_Toe_Cntrl circle handle is rotated, it will rotate the entire foot off the ground with the toe as the axis.

Step 41: Make L_ToeIK, a child of L_Heel_Cntrl.

Step 42: Make L_Toe_Cntrl_Group, a child of L_Heel_Cntrl.

Why?

Now, in the same way that the L_Toe_Cntrl circle handle will rotate the entire foot off the ground from the toe, the L_Heel_Cntrl will rotate the entire foot off the ground but this time centered on the heel.

Warnings and Pitfalls

Notice that this method leaves the L_Heel_Cntrl handle behind when the L_Toe_Cntrl is used to rotate the foot. This is OK. It’s not quite as elegant as it could be — but getting that to all be that elegant involves some stuff we really don’t need to worry about here. Just note that this is planned behavior.

Create a Master Foot Handle

Step 43: Create a circle that lays flat on the floor plane. Do this with Create > NURBS Primitives > Circle (Options) and change the Normal Axis to Y. Name it L_Foot_Cntrl.

Step 44: Group L_Foot_Cntrl to itself and name the new group L_Foot_Cntrl_Group.

Step 45: Move the L_Foot_Cntrl_Group and snap it to L_Ball_Joint.

Step 46: Orient Constrain the L_Foot_Cntrl_Group to the L_Ball joint. Remember to do this, in the Outliner, first select L_Ball joint, then Cntrl-select L_Foot_Cntrl_Group and choose Animation|Constrain > Orient. Then be sure and delete the orient constrain node it creates.

Step 47: Shape the handle. To do this, right-click on the L_Foot_Cntrl curve in the View Panel and select Control Vertex from the marking menu. Move the vertices (only along the X and Z axis) to create a shape you like around the foot (Fig. 8.23).

image

FIG 8.23 Shaping the handle around the foot.

Warnings and Pitfalls

It’s fairly critical that the control vertices do not lift up off the floor plane. Be very careful to only move them using the X and Z handles.

 

Why?

The exact shape is fairly arbitrary. The goal is to get that foot handle, so that it is easy to see and grab to control the foot rig. Definitely make it bigger than the foot geometry, but not so big that it will get visually tangled with the other foot.

Step 48: Make L_Heel_Cntrl_Group, a child of L_Foot_Cntrl.

Step 49: Repeat steps 30–48 for the right foot.

Further Organization

We’re in a good place for this rig. There are other things that could be done (individual handles for each of the back joints for instance). But for now we have a solid foot rig that will allow the lower body to be animated. The upper body will be animated by selecting the joints directly and rotating them.

What’s left is to make sure we have the rig set up, so we can easily move the whole thing. So there’s just a bit of extra organizing to be done.

Step 50: Create a really big letter. To do this, go to Create > Text (Options). In the Text input field, enter C (the alien’s name just became Carl). Click the Create button.

Step 51: Look in the Outliner for an object called Text_C_1. This is the parent of the parent of the actual C curve. Expand Text_C_1 and Char_C_1 beneath it and select the curve1 object. Hit P (that’s shift-p) to unparent this curve. Delete Text_C_1 and Char_C_1. Rename the curve to Carl.

Step 52: Scale and position the Carl curve, so it sits on the ground beneath the alien (Fig. 8.24).

image

FIG 8.24 Positioned C.

Step 53: Clean up the C. Do this by first, moving the C’s axis to 0, 0, 0 in world space. The easiest way to do this is to hold d and x down (d to move the axis and x to snap to grid) and dragging the manipulator handle into the center of the floor grid. Then choose Modify > Freeze Transformations.

Why?

All we’re doing here is making sure that the C’s handle makes sense — right beneath the alien — and that we have clean transformations for the C.

Step 54: Make all the joints and handles children of Carl. Do this at a time by middle-mouse dragging L_Foot_Cntrl_Group onto Carl, then middle-mouse dragging R_Foot_Cntrl_Group, and finally middle-mouse dragging Root onto Carl.

Warnings and Pitfalls

Safest to do this one at a time. If you shift-select all of these three objects and make them children of Carl, there can be some reshuffling of the hierarchy that is not good.

Step 55: Save and take a break.

Tutorial 8.2 Skin Weighting

Skin weighting or skinning is the process of attaching joints to a polygon mesh and deciding how the joints will actually deform the mesh. You’ve undoubtedly noticed that the joints of the rig will move but they don’t actually do anything to the alien; there is no relationship between the two.

The process will consists of really two major steps. The first is establishing the initial link between mesh and joints, which we’ll do with a Smooth Skin. In this step, Maya will make a guess as to which vertices are influenced by which joints.

The second step will be refining that initial guess that Maya makes. In some areas, Maya’s guess will be pretty good, but in others, it will be terrible. Through a process called Skin Weights Painting, we will go in and help Maya understand exactly which vertices are deformed by which joints.

Step 1: Make the eyes children of the Head joint. To do this, in the View Panel, select one eye, then shift-select the other. Finally, shift-select the Head joint and hit p.

Tips and Tricks

Note you could also have done this in the Outliner by middle-mouse dragging each of the eyes onto the Head joint.

 

Why?

Parenting meshes to a joint is the easiest way to tie polygons to a joint. In this particular game situation, we aren’t going to worry too much about animating the eyes. So, making sure that the eyes move when the Head joint moves will do the trick.

Step 2: Bind the mesh to the joint structure. To do this, in the Outliner, select the mesh that is the body and then Cntrl-select the Root joint. Choose Animation|Skin > Bind Skin > Smooth Bind (Options). In the Smooth Bind Options window, change Normalize Weight: Interactive and set Max Influence: 3. Hit the Bind Skin button.

Why?

There’s a lot to this window, and actually now Maya allows for different ways of creating and controlling skin weights. The way we are going to use this feature provides the best understanding of the magic behind the curtain. Later, you may decide to use some of the other methodology to manage skin weights.

The core idea to take from this step is that we are telling each vertex that it can be influenced by up to three joints (Max Influence = 3). There could certainly be cases where this might want to be higher (a complex back rig), but for our game character where there are few joints, there are really no situations in which any one vertex should be controlled by any more than three joints. And in fact, most will be influenced by two joints, and some vertices should only be affected by one.

Step 3: Test the bind. Start doing this by selecting the Root joint and using the Move Tool to move this joint. This will probably look alright. But then start using the Rotate Tool to rotate joints like the Head joint or the L_Shoulder joint. The results will be pretty strange (Fig. 8.25). Be sure to undo any rotations you make to get him back into his bind pose.

image

FIG 8.25 Testing the default bind. The results are usually pretty bad.

Component Editor

There are some areas where the binding will be pretty harsh. The head is one of those places. All of the vertices of the head should be influenced 100% by the Head joint. Among the quickest way to define this is through a tool called the Component Editor.

The Component Editor is basically a spreadsheet that will help us see where vertices are lending their influence to. Importantly, we can numerically define what the influences should be. The important thing to know is the paradigm that skin weights work within here.

The influence of each vertex is defined between 0 and 1. A joint that has an influence of 1 on a vertex has 100% influence — the vertex does what that joint does. A joint that has an influence of 0 on a vertex has no influence at all. A vertex can have its influence shared between joints — it can be .5 on one and .5 on another. Or, it can be .2 on one, .3 on a second, and .5 on a third. The key is the sum of the influences on any one vertex will always be equal to 1.

This means that if we define the influence for a vertex by any one joint to 1, Maya will strip all influence of any other joints on that vertex.

Step 4: Mask out the ability to select joints. Do this by turning off the joint mask at the top of the interface (Fig. 8.26).

image

FIG 8.26 Turning off the ability to select joints.

Why?

We need to be able to select some very specific components in the coming steps (vertices mostly). The problem is that Maya assumes that what you want to select are joints. This is very handy when animating and you want to be able to select through a mesh to grab hold of a joint; but it’s really a pain for us here. By turning off the joint mask, we can select vertices without grabbing joints.

Step 5: Select the vertices of the head. The easiest way to do this is right-click on the alien mesh and select Vertex from the marking menu. Then Marquee select the head — this will select the vertices all the way through the head.

Tips and Tricks

It’s a little hard to see selected vertices in a screenshot, so I’m not going to include one, but do make sure and rotate around the head to get an accurate selection on both sides of the head. The key here is to get all of the vertices of the head, but not down the neck.

Step 6: Assign the influence 100% to the Head joint. Do this by opening the Component Editor (Window > General Editors > Component Editor). Within the Component Editor, look for the Smooth Skins tab. There you will see rows that indicate the selected vertices (i.e., vtx156) and columns that indicate joints. Find the column labeled Head. Select the top cell in that column by clicking on it. Then scroll all the way down and shift-select the last cell in the Head column. Enter 1 and hit Enter.

Why?

The interface will clean up considerably. By assigning 1 to all the vertices of the Head joint, Maya has removed influence from all other joints and so removes them from the Component Editor for these vertices.

Step 7: Test the Head joint by selecting it and rotating it. The head should be holding its shape much better now (Fig. 8.27).

image

FIG 8.27 Updated head that maintains its shape through effective Component Editor manipulation.

Tips and Tricks

Since we’ve turned off the ability to select joints in the View Panel, you’ll find the quickest way to do this step is to select the Head joint in the Outliner.

Painting Skin Weights

Using the Component Editor is a very cerebral way to adjust skin weights. Indeed, the entire mesh could be managed this way by numerically entering desired weights for each vertex; but man, what a drag that would be. This, in addition to the fact that it’d take forever to adjust the weights this way.

Maya has provided some other methods to make this happen. The most visually intuitive method is through a Painting Skin Weights methodology. The only problem with this is that painting skin weights is really not much like painting a house and much more like painting a portrait; it’s an art and it takes a great deal of practice and experience.

This makes it a particularly challenging thing to write about (try writing out how to paint a portrait). It is best learned by doing it. So be prepared to do some experimentation to get the skin weights just right. But here are the basics of the technique.

Step 8: Enter the Paint Skin Weights Tool. You can do this one of two ways. First, right-click on the mesh and select Paint Skin Weights from the marking menu. Alternatively, if the mesh is selected, choose Skin > Edit Smooth Skin > Paint Skin Weights (Options). Either way, the Tool Settings window will open on the left side of the View Panels (Fig. 8.28).

image

FIG 8.28 Paint Skin Weights Tool settings.

Paint Skin Weights Tool

There are several things that are important to talk through here before we get going on using this tool. The first is to realize this works with Maya’s painting mechanism. When the Paint Skin Weights Tool is active, moving the mouse over the mesh will show a red circle that represents the size of the virtual paint brush that the user will paint with. By holding the b key down and dragging the mouse left and right, the paint brush size can be made bigger or smaller.

Next, take a close look at Fig. 8.28 and notice the Influence section. What is shown there are all the joints that are influencing the selected mesh. When any of these joints are selected within this Influences section, the influence of that joint will highlight on the mesh in the View Panel. So for instance, in Fig. 8.28, the Root joint is selected in the Influences section, and the influence of that joint is highlighted white in the View Panel. The parts of the model that are white are influenced 100% by the selected joint, whereas parts that are completely black have 0% influence. And grays are everything in between.

The Mode area’s default is Paint; which is generally what we’ll use here as the idea is to paint the value of the influence of the selected joint. The Paint Operation indicates what to do to the painted vertices (in this case Replace the value). Below that in the Value input field is the value of the influence that it is going to be replaced with. So, in this case (Fig. 8.28), anywhere that the mesh was painted on would be assigned 100% (Value of 1) to the Root joint.

So my personal work flow for the painting process is as follows:

1. Start with extremities (work from the end of the toe up to the Root or from the finger tips to the spine).

2. Paint with 1 in areas that a joint should be influencing 100%. So for the L_Elbow joint for instance, I would paint (Replace with a value of 1) all the vertices from the elbow to the wrist — these are the vertices that should be moving when the elbow joint rotates.

3. Flood with a Paint Operation of Smooth. This softens the border areas where the influence goes from 1 to 0 and makes for a slightly softer transition in skin weights.

4. Repaint areas to fine tune the results of the flood.

5. After doing all the joints in the left side of the body, start again with the extremities. It usually takes three or four passes before the deformations on one side of the body are working as I’d like. The reason for this is the fluid nature of painting skin weights. Because vertices have a total influence of between 0 and 1, if influence is added to a particular joint, that influence is taken from someplace else. This means that areas that have been painted might not stay exactly as you painted them. Multiple passes start to narrow down and solidify your choices.

6. Mirror Skin Weights.

So let’s see this in action.

Step 9: With the Paint Skin Weights Tool active, paint the influence of the L_Ball. Do this by selecting L_Ball in the Influences section and painting (Paint Operation: Replace, Value: 1) from the ball out to the toe to match Fig. 8.29.

Why?

So why not paint anything to the L_Toe? Well, in reality, the vertices shown here would only be influenced by the L_Ball joint. In the other parts of the body (the fingertips and head), we deleted that last joint — but for the foot — to facilitate the foot roll rig, we left the joint there. But it shouldn’t have any influence on the vertices.

 

image

FIG 8.29 Skin weight for the L_Ball.

Tips and Tricks

Don’t forget to get the sole of the shoe.

Step 10: Smooth the transition. To do this, in the Paint Skin Weights Tool Settings, change the Paint Operation to Smooth and click the Flood button.

Step 11: Paint the skin weights for L_Ankle. Again, swap the Paint Operations back to Replace and paint in the areas the L_Ankle should be controlling (Fig. 8.30).

image

FIG 8.30 Ankle Skin Weights.

Why?

So notice that these initial passes are a little aggressive and tend to go a little wider that you’d originally think. Part of this is because we’re going to flood the smooth operation, and we want to keep the core influence intact.

 

Tips and Tricks

For the ankles, be sure to get a really good solid influence painted on the heels.

Step 12: Repeat up the leg for the knee (Fig. 8.31) and the hip (Fig. 8.32). Continue and paint the area for the Root (Fig. 8.33).

image

FIG 8.31 First pass of knee skin weights.

image

FIG 8.32 Skin weights for hip.

image

FIG 8.33 Skin weights for Root.

Tips and Tricks

Remember that we are only painting for the left side of the body. For some things like the foot and leg, this is easy to remember, but also keep this in mind when working on joints like the Root. Even though the Root joint will eventually influence both sides of the mesh, you only need to paint one side now.

Step 13: Repeat the process for the arms by starting on the fingertips and moving up the hierarchy to the back (Figs 8.348.36).

image

FIG 8.34 Finger skin weights.

image

FIG 8.35 Elbow skin weights.

image

FIG 8.36 Shoulder skin weights.

Step 14: Repeat again from the neck down to the root.

Testing

Getting the skin weights right is unique to each and every model. The first pass through skin weights is almost never right. The way to test the skin weights efficacy is to start posing the character: start rotating the joints in the upper body. Move the feet control handles, and see if the character is deforming as planned. It probably won’t.

Not to worry though. Remember that you can paint the skin weights when the character is posed. So move that leg up to a walking position, and then select Paint Skin Weights and paint the skin weights as they ought to be. Then just be sure to get all the joints back into position (enter 0 for Rotate X, Y, and Z for upper body, and enter 0 for Translate X, Y, and Z for the foot controllers).

Mirror Skin Weights

After testing one side, you can quickly move the skin weight work done on that side to the other.

Step 15: Mirror the skin weights. Do this by selecting the mesh and choosing Skin > Edit Smooth Skin > Mirror Skin (Options). Here, make sure Mirror Across: YZ and check the Direction: Position to Negative (+X to −X) check box. Hit Mirror.

Why?

The Mirror Across option here should be pretty clear by now (we’re mirroring across a plane that would pass through the Y and Z planes). We check the positive to negative option because we have been painting the character’s left — which is on the positive side of the X direction, and we want to copy from the positive X part of the character to the negative X.

Step 16: Test some more.

Step 17: Paint and adjust some more.

Step 18: Test some more.

Step 19: Paint some….ah, heck, you get the idea.

Conclusion

Painting skin weights is a journey. When it’s working right, effective skin weights are magic as suddenly the character feels alive. But it takes a while to get them right. Even when you think they are right in this version, once the character starts to animate, new problems will appear that weren’t obvious in the painting process. My solution is available for download at the supporting website, and I guarantee as I write the animation chapter, I’ll discover problems that need to be addressed — and will go back and fix the skin weights. It’s all part of the process.

Have fun with skin weights. It really can be a very zen-like experience filled with moments of interesting problem solving. Block off some good time to do this. A sloppy skin weight will forever affect the look of the animations you make with this rig. Getting it right is important.

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

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