Joint-Based Facial Animation Setup (Kila)


The most obvious way to animate a character's face is to use joints, because we are already employing them to animate the body. We simply place joints at certain places around the character's face, which will then act like muscles, moving the vertices around and animating the face.

Where do we put facial joints to get the best facial expressions on Kila?

  • We need one to operate the mouth, opening and closing the jaw.

  • For the eyes, we'll add joints that operate the eyelids.

  • Joints at several locations around the mouth will give movement to the lips, enabling the character to form words.

  • The eyebrows contribute a lot to facial expression, so we can add joints to move these as well.

  • If our budget allows, we can add the ability to animate the tongue.

  • Two more joints will add movement to the cheeks.

This list includes quite a few extra joints, so for your own project, make sure you have room in your budget. In this chapter, we will implement them all.

Joint Placement

As we did with Kila's breasts, we will rely mostly on the translations of joints to animate the face. We only need to add joints to the left side of her face, and then mirror these to create the right side.

1.

Open up the file Kila_MainRig.mb and, using the visibility controller we added in Chapter 12, turn off all the icons.

2.

Switch to the side view, and hide her hair and the main skeleton so you can concentrate on her face. Turn the geometry layer visibility to Template.

3.

Using the Joint tool found in the Skeleton menu, place Kila's jawbone as shown in Figure 13.1a. Call the first joint Jaw, and the second Jaw_Tip.

Figure 13.1a-c. Place the joints that will animate the left side of Kila's face


4.

Place three joints that will control her tongue, using the actual tongue geometry to guide you. Call these TongueBase, TongueMiddle, and Tongue_Tip, before parenting TongueBase to the Jaw joint (Figure 13.1b).

5.

Following Figure 13.1c, place two single joints in exactly the same place as the eye joint. (You will need to make the base skeleton visible again for this step. Set it to Reference, so that you will be able to snap the new joints to the ones on the base skeleton.)

We need the eyelids to follow the same rotations as the eyes, so these joints need to be in the same position as the eye joint. Use the Point Snap tool to position them correctly, and call them L_UpperLid and L_LowerLid.

6.

Add three separate joints around her lips, placing one at the top, one at the corner of her mouth, and a final one on the lower lip (Figure 13.1d). Call these L_UpperLip, L_OuterLip, and L_LowerLip.

Figure 13.1d-f. Place the joints that will animate the left side of Kila's face.


7.

Place two joints along the eyebrow, calling these L_InnerBrow and L_OuterBrow (Figure 13.1e).

8.

Create a joint that will animate her cheek, calling it L_Cheek (Figure 13.1f).

9.

Switch to the perspective view now and move all except the jaw and tongue joints away from the center, placing them in the areas for which they were intended (Figure 13.2, middle).

Figure 13.2. Move the new eye, eyebrow, and cheek joints away from the center and into their correct places.


NOTE

As illustrated in Figure 13.2, right, make sure the joints lie half in and half out of the actual geometry. This way, they will give an accurate movement when animated.

10.

The joints are now in position, so make the main skeleton visible again. Then parent all the joints except TongueBase, TongueMiddle, Tongue_Tip, Jaw_Tip, and LowerLip to the main head joint. Parent the LowerLip joint to the jaw joint because it will move with the bottom jaw.

TIP

You may find it easier to select the joints in the Outliner. A quick way to navigate through the hierarchy is to select any of the joints belonging to the face in the main view; then right-click in the Outliner and select Reveal Selected. You will be taken to the selected joint in the Outliner, which in turn will reveal the rest since they all lie in the same place.

Next, simply use the Mirror Joint tool to copy each joint across, creating the right side joints. Do all except for the jaw joints.

1.

Select one of the new face joints and go to Skeleton > Mirror Joint.

2.

In the tool options, set Mirror Across to YZ. Under the heading "Replacement names for duplicated joints," put L_ in Search For, and R_ in Replace With.

This will automatically rename the joints for you so that they represent the right side.

3.

Click on Apply to mirror the joint and keep the window open. Now repeat this for each of the remaining face joints.

NOTE

Remember to reset each joint's rotational axes, especially after you have mirrored them. Select all the new joints and use the rsJnt button on the GCDM shelf. Use the orJnt button on the jaw and tongue joints.

You can see in Figure 13.3 that the face is looking pretty complicated right now, and to an animator this would be a nightmare to pose. But we can rig the face just as we did the body, making it easier to get basic poses and mouth shapes. In order to do this, the joints must first be bound to the mesh and their positions tested.

Figure 13.3. The face with the full joint configuration


Preparation and Binding

Although binding isn't covered until Chapter 14, "Final Character Deformation," we want to make a start now on this process so that we can fully rig the face.

To successfully bind Kila, we need her to be a single object. Your game engine may not handle multiple objects, so in this case it's safest to combine Kila's polygons.

1.

Select each element that makes up the highest level of detail and go to Polygons > Combine. This will create a single object; rename it to Kila_LOD01.

2.

Because she started out as separate objects, combining Kila won't have welded the vertices between each element. Look at Figure 13.4, middle. At the line where her head meets her hair, there are two vertices lying on top of each other. You can easily select one and move it down, which creates an undesirable hole.

Figure 13.4. Merge all the seams, welding the vertices together.


To fix this, select all the vertices of her head and hair and go to Edit Polygons > Merge Vertices, setting the value to a small number such as 0.0001. This way, only vertices that lie on top of each other will be welded (Figure 13.4, right).

3.

Double-check each area that this welding should have affected, including the hairline, eyelashes, and inner mouth. Make sure that the lips, though, have not been merged.

4.

Combining Kila into a single object will have placed the geometry out of the LOD group, so quickly make sure she is again parented to the Kila4096 group. This will ensure the LODs still work.

5.

Delete the history on the mesh.

NOTE

There may be a stray node still in the Kila4096 group; this may have been missed when we deleted her history. She is a single model now, though, so it's safe to delete this node. Use Hypergraph or Outliner to check for this issue.


The first LOD for Kila is now a single mesh, which will make her easier to work with. Now let's connect her to the base skeleton.

1.

In the Outliner, navigate to the first joint of the base skeleton; this should be called Root. Select it and open up the hierarchy by Shift+clicking on the plus sign (+) next to Root.

2.

Go to Edit > Select Hierarchy to select all the objects beneath Root.

3.

Although the skeleton hierarchy is selected, you don't want to bind all the joints. Scroll down the Outliner and, holding Ctrl, deselect all the joints ending with _Tip. These are only here as visual aids and don't deform the character.

Also make sure you only have joints selected. Unselect any icons, constraint nodes, or effectors (which are part of the IK system and usually named "effector") that may also be selected.

4.

With just the correct joints selected, hold Shift and add the Kila mesh to the selection.

5.

Go to Skin > Bind Skin > Smooth Bind and open the options. For Bind To, choose Selected Joints, and for Bind Method, choose Closest Joint. Set Max Influences to 3, and Dropoff Rate to 4.

6.

Click on Bind Skin, and the skin is now attached to the base skeleton. You can test this by moving some of the control icons (Figure 13.5, right).

Figure 13.5. Test the bind by moving some of the icons around.


TIP

On the GCDM shelf, you'll find a button labeled Bind. This will automatically select the joints needed and bind the selected skin to them, while making sure no unwanted objects are included.


Save the scene as Kila_FaceBind.mb.

We will leave binding the rest of the body until Chapter 14. For now, let's concentrate on the job at hand and edit the weighting information on the face.

Joint Weights

Since we covered the various weighting tools and options in Chapter 6, we can now get right to it and work on the facial joints.

NOTE

Unless specified, we will mainly be using the paint operation Replace, from the Paint Weights pane in the Paint Skin Weights options.


We will be moving the joints around, so it would be prudent for us to first store their current translations. Since the joints' translations cannot be frozen, we will set a keyframe on them, thus storing their default pose.

Figure 13.6 shows the Time Slider at the bottom of the Maya window (the main bar with numbers in it). This controls time in Maya; simply clicking in the slider will alter the frame you're on. We will discuss the Time Slider in more detail in Chapter 16, "Animating for Games."

Figure 13.6. The Time Slider


On the Time Slider, make sure you have frame 0 selected; then select all the joints associated with the face. Right-click in the Channel Box and select Key All from the menu. The attributes will turn orange to indicate they are keyframed.

We have thus stored the joints' positions at frame 0; you will be able to see a thin red line indicating that the selected object has a key set on it. We can still move the joints around, but to return them to their default pose we need only click on frame 0 in the Time Slider. The only way to store a new pose would be to set another key.

With the joints, positions safely stored, let's look at adjusting the weights on her jaw and lips.

Jaw and Mouth Weights

The jaw joints are first; they'll allow us to open and close her mouth.

1.

Make all the icons invisible. Focus in on the face and make sure you can see the base skeleton (Figure 13.7, left).

Figure 13.7. Rotate the jaw joint so that you can see how the weighting looks.


2.

Following Figure 13.7, right, rotate the main jawbone down to where the mouth would be open. As you can see, the weights are not distributed properly, so you need to go in and tweak them.

3.

Select the main character model, and go to Skin > Edit Smooth Skin > Paint Skin Weights Tool and open the tool's options.

4.

Set both Brush Opacity and the Paint Weights Value to 1, and select the Jaw joint so that you can edit its weights (Figure 13.8).

Figure 13.8. Set the Paint Skin Weights tool settings and select the Jaw joint.


5.

Using the solid brush, fully weight the bottom of the jaw (including her bottom teeth and tongue) to the Jaw joint.

6.

Reset the Paint Weights Value to 0.5, and paint over the middle of the mouth at the corners and cheeks (this is the area halfway between the upper and lower lips), as seen in Figure 13.9, left.

Figure 13.9. Adjust the weights for the jaw and head joints, fixing the mouth.


7.

Select the head joint, and set Paint Weights Value back to 1. Fully weight the top of her head (including her upper teeth and lip) to this joint (Figure 13.9, middle).

As you can see in Figure 13.9, right, the mouth now looks better when it is open. But the problem now is that it's too round when open, so we need to bring the sides of the mouth in.

We will now adjust the weighting for the lip joints we created. This will help to adjust the shape of her mouth when it is open.

1.

Reset the joints back to their default positions by moving the Time Slider to a different frame, and then back to frame 0.

2.

Move outward all six joints that will operate the lips (Figure 13.10, right). When they're weighted, these joints will open the lips but keep the teeth together.

Figure 13.10. Move the joints for the lips slightly outward from the mouth.


Because we fully weighted them to the jaw and head joints, the vertices around the mouth are being told to ignore the lip joints. Let's attend to this next.

3.

With a softer brush and a smaller Opacity value (say, 0.10), start to add weighting information for just the left three lip joints. Make the vertices on the inside of her lips almost fully affected by the joints, with the influence gradually fading as you get farther from the mouth. This will cause the lips to flatten slightly as they part, just as they would do naturally.

As you are adding the weights, you will see the lips begin to open up, with the vertices moving gradually toward the joint you are working on (Figure 13.11b).

Figure 13.11. Add weighting to the lip joints


4.

When you are happy with the weights, you can mirror them across to the joints on the right side of her mouth. First, though, you have to reset the joints back to their default position; if they are not reset, the weights will not mirror properly. In this case, it's as simple as returning to frame 0.

5.

Select the geometry and go to Skin > Edit Smooth Skin > Mirror Skin Weights, setting Mirror Across to YZ and enabling Positive to Negative as the Direction. The weights will now be copied across, as shown in Figure 13.11c.

Work more on the shape of the lips; they should look like those in Figure 13.11d. To add additional realism to the face make the upper lips influence her nose slightly. Keep opening the mouth up (Figure 13.11e) to get a better idea of how the mouth looks with the new weights. Remember, though, that you will now have to position the outer lip joints, too, since these will control the corners of the mouth.

When you've finished this phase of weighting and adjusting, Kila's jaw and lips will be fully controlled by the joints.

Deleting History

While manipulating the lip joints, you may notice that the inner mouth pops through the teeth or gums. You can at this stage flip or delete any edges that do this, but at the cost of creating history on the model.

If you are using Maya 6, you can delete the construction history without losing the weighting information. Simply select the mesh and go to Skin > Edit Smooth Skin > Delete Non-Skin History.

If you are using an earlier version of Maya, however, there is unfortunately no easy fix. What you can do, once the face and rest of the body are fully rigged and you've made the necessary mesh modifications, is duplicate the meshthis will delete the history on the duplicate.

Make sure the duplicate is placed inside the correct LOD group; then bind it to the skeleton, making sure you bind it using exactly the same joint selection. If you originally used the Bind button on the GCDM shelf, use it again here; this will guarantee the joint selection is the same.

Select the main mesh. Then Shift+select the duplicate and go to Skin > Edit Smooth Skin > Copy Skin Weights. All the weighting information will now be copied across to the duplicate character model; you can delete the original mesh, leaving a clean character.


Now we will complete the mouth by adding control to her tongue. Again, it's quite difficult to get to the tongue in order to weight it properly, so first open Kila's mouth some to expose the tongue more. We will now isolate it so that we can work on it more easily.

1.

Right-click on the Kila model and select Face, switching to face editing mode.

2.

Go to Edit Polygons > Selection > Selection Constraints, which opens the dialog box seen in Figure 13.12. This tool allows you to alter the way you select things.

Figure 13.12. Polygon Selection Constraints dialog box


3.

Near the bottom of the dialog box are the Propagation radio button selections. Selecting Shell will automatically expand our next selection to contain all the connected faces.

4.

Navigate inside Kila's head to the tongue and select any face on it; with the new selection setting, this now selects the entire tongue.

5.

Click on the Close and Reset button in the Polygon Selection Constraints dialog box.

6.

With the tongue selected, go to Show > Isolate Select > View Selected in order to work on just the tongue (Figure 13.13a).

Figure 13.13. Isolate the tongue and then adjust its weights.


7.

You want the joints to be visible, too, so use the Outliner to select the TongueBase and TongueMiddle joints. Then go to Show > Isolate Select > Add Selected Objects to make these visible (Figure 13.13b).

8.

As seen in Figures 13.13c and 13.13d, rotate the tongue joints down along the X axis. Then select the tongue geometry and open the Paint Skin Weights options.

9.

Fully weight the whole tongue to the TongueBase joint (Figure 13.13e).

TIP

Although you can't see the rest of the geometry, the paintbrush will still be able to select it, so make sure you are actually on the tongue before you apply any weights. Once you know you're on the right spot, try to keep the mouse button held down because the brush will then move over the adjoining faces.

10.

Finally, weight the lower half of the tongue to the TongueMiddle joint (Figure 13.13f).

11.

When you're finished, reset all tongue joint rotations back to 0.

The mouth area is now complete; so let's continue on to the eyes.

Eye and Eyelid Weights

We need to add control to the eyes and eyelids so the character can look at things as well as blink.

Getting to the geometry for the eyes might be tricky, so we'll isolate just the general area we need to work on. To do this, simply select the faces around the area of the eyes and, on the current view, go to Show > Isolate Select > View Selected. As you can see in Figure 13.14, only the faces you selected are visible, allowing you to work more easily and quickly.

Figure 13.14. Isolate the faces around the eyes.


Go to Skin > Edit Smooth Skin > Paint Skin Weights, open the options, and set both Brush Opacity and Paint Weights Value to 1. Fully weight the left eye's geometry to the L_Eye joint (Figure 13.15, top) and then the right eye's geometry to the R_Eye joint (Figure 13.15, bottom).

Figure 13.15. Add weighting to the eye joints.


Now, as you can see in Figure 13.16, when you move the EyeControl controller around, the eyeballs will follow.

Figure 13.16. After weighting the eyes, test to see how they rotate.


Next let's look at the eyelids. For this task we will work on the left side and then mirror the weights.

1.

Select the joint named L_UpperLid and rotate it around the X axis about 15 units. Rotating the joint allows you to see what effect the weights will have on the mesh. Figure 13.17, top, shows you the current influence this joint has, which is none.

Figure 13.17. Adjust the weights on the upper eyelid.


2.

Open up the Paint Skin Weights options. In the Influence pane, select L_UpperLid. Set Brush Opacity and Paint Weight Value to 1.

3.

Paint on the lower vertices of the left upper eyelid and eyelash, leaving the very corners of the eye alone (Figure 13.17, middle).

4.

The eyelid now has quite a harsh, angular look to it; let's fix that. Turn Value to 0 and Opacity to around 0.1; then reduce the amount the eyelid affects the outer vertices, rounding the eyelid as it closes (Figure 13.17, bottom).

The upper eyelid is complete; now to repeat the procedure for the lower lid.

1.

Set the L_LowerLid joint's X rotation to 7.

2.

With Value and Opacity set to 1, fully weight the upper vertices of the lower eyelid to the joint (Figure 13.18, middle).

Figure 13.18. Adjust the weights on the lower eyelid.


3.

With Value reset to 0 and Opacity reset to 0.1, go in and smooth out the lower lid, giving it a better curve (Figure 13.18, bottom).

TIP

Don't worry about the eye geometry popping through the eyelids at this stage. Later, when we rig them, we can make the eyelids move forward slightly, which will hide this problem.


Mirroring the weights of the eyes isn't as straightforward as it was for the lips. Currently we have three joints residing in the same place on either side. This will confuse Maya when we ask it to mirror the weights because it won't know which joint to copy the weights to. To prevent this, simply move both UpperLid joints up slightly and the LowerLid joints down. Giving them their own individual locations will help Maya choose which joint to mirror across to. As long as the rest of the body is in the default position, the weighting should mirror successfully.

Select the mesh and go to Skin > Edit Smooth Skin > Mirror Skin Weights. There is no need to set the options; Maya will have retained the previous settings. When you're done, snap the eyelid joints back to the eye joints.

We will be mirroring the weights in the eye area quite often, so I suggest moving the eyelid joints and setting a key while on frame 1. This way, you will merely need to switch to frame 1 when mirroring weights, rather than having to move the eyelids each time.

1.

To set this key, first move along to frame 1 in the Time Slider.

2.

Move each of the joints into position.

3.

Select all four joints and set a key in the Channel Box, by right-clicking it and selecting Key All from the menu.

As shown in Figure 13.19, the eyelids now follow their joints and can be made to open and close.

Figure 13.19. The eyelids now open and close.


We are almost done with adjusting the weights on the face; all we need to do now is work on the eyebrows and cheeks.

Eyebrow and Cheek Weights

First, the eyebrows.

1.

Start by moving each of the left eyebrow joints up slightly so they are away from their default positions.

2.

Select the mesh and open the Paint Skin Weights tool. Set Paint Weights Value to 1, Brush Opacity to 0.5, and select the joint named L_InnerBrow.

3.

Using a softer brush, paint in the area of the eyebrow. Make the vertices closest to the eyebrow almost fully affected by the joint; allow the influence to fade out as it moves away (Figure 13.20, middle).

Figure 13.20. Add weighting to the left eyebrow.


4.

Select the joint named L_OuterBrow. Apply weighting similar to the inner section of the eyebrow (Figure 13.20 bottom).

5.

Mirror the weights by first going to frame 1 and then selecting Skin > Edit Smooth Skin > Mirror Skin Weights. Although the eyebrow joints exist in their own space, the mirror weights tool works globally; so even though we are mirroring the new eyebrow weights, the eyelids will be mirrored, too.

Try the eyebrows in different poses before you decide they are complete (Figure 13.21). It may be that they look fine in one pose but do not work in another and so will need some minor tweaking.

Figure 13.21. Try the eyebrows in a number of poses.


TIP

When mirroring weights, always check the vertices down the center of the model. These tend to end up with incorrect weighting information, so make sure to check them after mirroring.


The last area to edit is the left cheek. You want to add more subtle movement to the face as she talks, giving her a more organic feel. The cheeks need a soft influence on the geometry, so use a soft brush and apply a higher influence close to the joint, then gradually fade this out (Figure 13.22).

Figure 13.22. Add weighting to her cheek.


We have one final tweak to perform before our weighting tasks are complete. Select the head joint in the Influences pane of the Paint Skin Weights settings, and make sure the main sections of hair are weighted fully to it (Figure 13.23, left). Switch the Paint Operation to Smooth, and set both Value and Opacity to 1; then give the edges of the cheeks and eyebrows a general smoothing (Figure 13.23, right). This will be a subtle change, but it will smooth out the overall movement of her skin.

Figure 13.23. Smooth out the edges of the cheeks and eyebrows.


The facial joints are now bound and weighted to the character's skin and ready to be rigged. Save the file as Kila_FaceWeight.mb.



    Game Character Development with Maya
    Game Character Development with Maya
    ISBN: 073571438X
    EAN: 2147483647
    Year: 2004
    Pages: 169
    Authors: Antony Ward

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net