Blend Shapes Facial Animation Setup (Kila)


Blend shapes work by referencing the vertices from a duplicate of the main mesh. The duplicated vertices are edited to create a facial expression into which the main head will morph on command. Suppose the duplicate face is edited to represent an open mouth. Using the Blend Shape window, you can then tell the main face to gradually morph into the duplicate, making the character's mouth open and close.

Depending on the system for which you are developing, the number of available blend shapes might be restricted, so always check with your manager first. Work with as few blend shapes as possible. In this section, we will work with just a few basic shapes, and you can add more if you have the budget to do so.

Our first step is to prepare the geometry.

Preparation for Blend Shapes

Open up the file called Kila_MainRig.mb and turn off visibility for all the icons. We can't use the geometry in its current state for our work with blend shapes, so (as we did with the joint rig) we need to combine all the separate elements of Kila into one object.

With the first LOD combined into a single element, we could duplicate the whole figure and use that as our morph target, but that would be a huge waste of memory and processing power because we only need to alter her face. So we will separate her face from the rest of the body, and then combine the rest. In effect, there will be two separate mesh objects.

1.

Switch to the side view and hide her hair, as seen in Figure 13.32, left.

Figure 13.32. Extract Kila's face.


2.

Following Figure 13.32, middle, select the faces that make up her principal face area, as well as the ones under her jaw (these will move as she opens her mouth).

3.

With these faces selected, go to Edit Polygons > Extract. This separates the face from the body (Figure 13.32, right).

4.

Because the eyelashes, inner mouth, teeth, and tongue will move as the face moves, you need to combine them with the face's geometry. (This can be done much more easily in perspective view.) Select all these elements, and go to Polygons > Combine to combine them.

NOTE

When blend shapes morph from one shape to another, the vertices follow a linear path. This won't work for elements that rotate, so we'll leave the eyeballs with the main body, controlling them with joints instead.

5.

Now you need to weld all the duplicate vertices that lie in the same place; this stops the mesh from tearing as it moves. Select all the vertices of the combined face, and go to Edit Polygons > Merge Vertices and set the value to a small number (say, 0.0001).

Double-check that coincident vertices are indeed merged and that areas with deliberately small gaps (like the mouth) were not inadvertently merged.

6.

Center the pivot for the face (Modify > Center Pivot). This will make it easier to manipulate later.

7.

The face is now its own object and perfect for creating Kila's blend shapes. Delete the history on both the separated face and body geometry.

8.

Unhide the hair; then combine all the other pieces that make up her body, including the eyes and belt. You could at this stage hide the face to make this step easier.

9.

Weld the vertices around the ear and hairline with a small value like 0.0001.

10.

Finally, delete the history on the body.

The mesh is now ready for generating face shapes. Move the geometry for both the face and the body back inside the Kila4095 folder in the Outliner. Then rename the body to KilaBody and the face to KilaFace. Save the file as Kila_Combined.mb.

With the face detached and the rest of the body combined, we can start to build up our library of face shapes.

Generating Face Shapes

Creating blend shapes is a simple task involving nothing more than editing vertices. The faces we create will essentially be the same as the poses we generated for the joint-based facial rig.

To start, we will generate the Ahh shape so that we can test the mouth before continuing on to create shapes that will animate the eyelids and eyebrows. We will then create the O, L, MPB, FV, Ooo, Smile, and Frown shapes. You will notice that, unlike the joint-based facial setup, we don't create face shapes for CDENSZ and AKI. Since we are limited in the overall number of blend shapes we can use, we will use the Ahh and Smile shapes together to create CDENSZ and AKI. Efficiency is also called for in the creation of some base facial poses, including Shock, Angry, or Happy. These can all be done via the other basic shapes.

NOTE

It's important that the geometry is fully tested and complete before you create the blend shapes. If the topology is altered in any way afterward, they will have to be redone. Each vertex is assigned a number in Maya, and blend shapes work with these numbers. Altering the topology means altering the vertex numbers, so the face shapes will no longer work. You can still flip and edit edges, as that doesn't affect vertex numbers.


TIP

Do not freeze the transforms on any of the face shapes. The vertices work on a relative basis, so all transforms should remain intact. If not, when you blend the main face to one of the others, the whole face will move to its target.


Let's create the Ahh shape.

1.

Duplicate the face and move it over to the left of the main model. Name this copy Ahh.

2.

Hide the main model. Then, following Figure 13.33, left, select all the vertices that make up the bottom jaw, teeth, and tongue, but not the vertices that lie on the edges of the model.

Figure 13.33. Rotate the vertices of the jaw.


3.

Press E to switch to the Rotate manipulator; then press Insert and move the pivot point to the spot from which the jaw will rotate. You can see this in Figure 13.33, middle.

4.

Rotate the jaw around the X axis so that the mouth is open (Figure 13.33, right).

5.

As you can see in Figure 13.34, left, the mouth doesn't look right yet. Spend some time editing the vertices on the head to sculpt the shape of the mouth (Figure 13.34, right).

Figure 13.34. Sculpt the vertices to fix the mouth area.


The first mouth shape is complete and we haven't noticed any problems. One good feature of blend shapes is that, even after they have been applied to the main model, you can still tweak the vertices to get the shape just right.

We'll do the eyebrows next, and learn a technique of creating two face shapes from one.

1.

Duplicate the main face again, and this time call it LeftBrowUp. Position it to the left of the Ahh face shape.

2.

Edit the vertices, this time to raise both eyebrows as shown in Figure 13.35.

Figure 13.35. Adjust the vertices to raise both eyebrows.


TIP

To save time, select the same vertices on each side of the face. This way, when you move them, both sides will be exactly the same.


This shape is acceptable for moving both eyebrows at the same time, but we want Kila to be able to move them individually, as well.

3.

Duplicate this face, calling it RightBrowUp, and move the copy over to the left (Figure 13.36a).

Figure 13.36. Use the Channel Box to reset the eyebrows.


4.

On LeftBrowUp, select all the vertices you edited on Kila's right side (Figure 13.36b).

5.

Look in the Channel Box, and you'll see a new heading labeled "CVs (click to show)," as seen in Figure 13.37, left. Click on this heading to reveal all the selected vertices, plus their current positions relative to the face's default pose (Figure 13.37, right).

Figure 13.37. Reset the values in the Channel Box to return the vertices to their default positions.


6.

Select all the coordinates and set them to 0. This resets the selected vertices back to their default positions (Figure 13.36c).

7.

Select the central vertices (Figure 13.36d), and in the Channel Box set them to be half of their current values.

Why are we setting the central vertices to half? Each blend shape works relatively; that is, the vertex positions are added to any that are already applied. So if the left eyebrow and right eyebrow shapes fully affected the central vertices on the head, when both shapes were applied these vertices would move double the distance.

So when we set vertices that may need to share their values to move half the amount for each eyebrow, it means that when both are applied at the same time, the central vertices won't move too far up. They'll wind up where you actually want them to be.

8.

On the RightBrowUp model, reset the vertices on its left and center (Figure 13.36e), just as you did for LeftBrowUp.

The technique you've just used is a quick and easy way to get two shapes out of one; plus, you will know that each side will be the same. It may be that you don't want the face to be symmetrical, which is fine, but this way you get a good starting point from which you can tweak later.

Go ahead and create the rest of the face shapes needed, by simply duplicating the main head and editing the vertices. You should have the following:

  • Both the left and right eyebrows, lowered.

  • Both individual eyelids opening wider and closing.

  • The remaining facial shapes L, MPB, FV, Ooo, Smile, and Frown.

TIP

For the eyelids, you will need to use the shape of the eyes as a guide, so keep the duplicated head in its default position until you are happy with the eyelid shape.


You can see all of these shapes in Figure 13.38. These represent a good initial group of face shapes for a character. If your budget allows, you can add more to get more refined manipulation of the face.

Figure 13.38. Blend shapes for Kila's face


With the entire library of face shapes complete, we can now apply them to our main model.

Blend Shape Application

The geometry shapes are ready, so now we can connect them to the main face model, allowing us to morph the face into any of the new shapes.

1.

Select all the face shapes, adding Kila's main face to the selection last.

2.

Go to Deform > Create Blend Shape, and set the options seen in Figure 13.39.

Figure 13.39. Create Blend Shape options


3.

We will use the default options, so just set BlendShape Node to Kila_FaceShapes; this defines the name for the actual blend shape controller.

4.

Click on Create to create the blend shape controller.

To animate the blend shapes, go to Window > Animation Editors > Blend Shape, which opens up the window shown in Figure 13.40, left. Moving the sliders will animate the main face, morphing it into its target shape. Pressing Select will select the node, enabling you to animate it via the Channel Box (Figure 13.40, right).

Figure 13.40. The Blend Shape window


NOTE

You can change the orientation of the sliders by going to Options > Orientation and selecting either Horizontal or Vertical. Vertical is the default view.


Now that the blend shapes are set up, take some time to edit each face, tweaking the vertices until you are satisfied with the final shapes.

Place all the face shapes in a new group called Bshapes; then move this node so it is under the Kila4095 group.

Create a new display layer called BlendShapes, add the BShapes group to it, and save your scene as Kila_FaceRig_BS.mb.

TIP

Once the face shapes have been applied to the main face, you can delete them. However, I recommend keeping them in the scene for as long as you can. This allows you to easily edit them if you need to.


The animator will quite happily use the Blend Shape window to animate the character. If you like, though, you could use Set Driven Key to tie the blend shapes into the main head controller, as you did with the joint setup.

Facial Animation and LODs

You have now worked through two approaches to facial animation on Kila, but what about the LODs? Giving a character the ability to be seen talking might be unnecessary at a distance, but you may need it for the next level of detail.

For the joint-based face, all the hard work has already been done. Because all the animation is applied via the joints, we can simply bind the lower LODs and then copy the weighting information across. We will be covering this process in Chapter 14.

The blend shapes, however, will need further work in terms of LODs. These shapes reference a copy of the face's geometry, so we will need to create the required blend shapes for all the LODs. This might seem a daunting task, but getting organized ahead of time will help. Before you start, consider what will actually be seen at that distance and what the geometry will allow. Dolly out until Kila is just about to switch to her next LOD; then use the Blend Shape window to see what face shapes are visible and actually distinguishable.

Certainly at this distance you can see that her mouth is open or closed, her eyebrows are raised or lowered, and her eyes are open or closed. The smile is clearly visible, but the rest of the mouth shapes can hardly be seen, so it wouldn't be advisable to re-create these for the lower LOD.

With the blend shapes created and applied, you can use the Connection Editor to connect the lower-LOD blend shape nodes' attributes to the higher ones. When you animate the highest LOD, the lower ones will follow; that means you and the animator don't need to animate each individual LOD.



    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