Painting Kila s Weights


Painting Kila's Weights

In Chapter 6, we used weight painting briefly to get an idea of how the geometry would deform. Now we will be applying the final weights, so we have to make sure all areas of her body move correctly.

We will concentrate on her left side, and then copy the weights across to the right when we are done.

Load the file Kila_FaceRig_Jnt.mb and we will start work on her arms.

Arm Weights

The arms are probably the most important area to weight correctly. They are always in motion and can move dramatically in all directions, which unfortunately will show off any badly weighted areas.

Shoulders

The shoulder is capable of moving around in all three axes. Not only does it raise and lower, it can move forward and backward, and also twist. Obviously, depending on what your own character's primary actions will be, some of these poses will be more important than others.

Let's first look at the shoulder as it is raised and lowered.

1.

Using the visibility icon, turn off the middle and right icons so that we can concentrate on her left side.

2.

Focus in on her left arm; rotate the shoulder down and look at how the mesh deforms when it's in this rest position.

As you can see in Figure 14.1, the area under her arm moves into her torso, which we don't want it to do.

Figure 14.1. Lower the arm by rotating the shoulder.


3.

Select the geometry itself. Then go to Skin > Edit Smooth Skin > Paint Skin Weights Tool and open up the options. Set Value to 0 and Opacity to 1, and in the Influence pane make sure you have L_Shoulder selected.

TIP

If you need to see the actual texture of the model while you edit the weights, open the Display pane found in the Paint Skin Weights window and uncheck Color Feedback. In some instances, the actual texture will play a part in disguising some of the pinching as the character deforms, so it's good to keep checking the textured version of your model, too.

4.

As demonstrated in Figure 14.2, right, paint just under her arm, doing the front of the torso as well as the back. Also paint above the shoulder, removing the influence the shoulder has over this area.

Figure 14.2. Remove the shoulder's influence from the torso.


5.

Select Smooth as the Paint Operation. With a softer brush, edit the shoulder itself, smoothing it out and rounding it off. Using Smooth will average out the distances between each vertex, adding a subtle change to the weighting values but smoothing the overall shoulder as it deforms.

6.

Rotate the arm as shown in Figure 14.3, so it is almost horizontal. (If you raise your own arm, you will notice that it will not rotate above this level; it is your clavicle that takes over and raises the arm further.)

Figure 14.3. Raise the arm so it is horizontal.


Check to see how the shoulder and armpit areas look. You may need to smooth the armpit slightly but other than that it should look fine.

Now let's examine the shoulder as it rotates forward and backward. With the arm still in its horizontal position, rotate it forward around the Y axis (Figure 14.4). As you can see, we have some severe pinching that needs attention.

1.

Reduce Brush Opacity down to around 0.15, and keep Paint Weights Value at 1. Using either Replace or Add, try and tweak the weights around the shoulder to minimize the pinch (Figure 14.5). You won't be able to remove it completely; just try to make it less obvious.

Figure 14.5. Tweak the weights to reduce the pinch.


2.

Reset the arm back to its default position; you can do this quickly by setting the shoulder rotations to 0, 0, 0 or right-clicking on the selection handle and selecting Assume Preferred Angle. Now rotate the arm forward, making the geometry deform in a different way.

Edit the pinching as needed.

3.

Now test how the shoulder looks when the arm is bent backward. Again here, the arm has limited movement when rotated backward from a raised position.

Figure 14.4. Rotate the arm forward around the Y axis.


Manual Assignments Using the Component Editor

If you are having trouble editing the weights on a particular area, you can go in and manually assign certain joints to affect certain vertices and by a certain amount, on a per-vertex level. To do this:

1.

Select the character model and go to Window > General Editors > Component Editor (Figure 14.6, top).

Figure 14.6. Making manual assignments in the Component Editor


2.

Select a vertex from the character model, and then select the Smooth Skins tab in the Component editor (Figure 14.6, bottom).

At the left of the window, you will see all the vertices you have selected (listed vertically). In this case, we have vtx[1816], which is vertex number 1816. All the joints that have influence over it are listed across horizontally. You can scroll over and assign each joint's influence over that vertex; 0 is no influence, and 1 is the maximum influence.

Although this method does allow you to be more accurate with the weight assignments, keep in mind that going through every vertex on your character can become quite tedious.


With the first two rotations fixed, we can now test the twist, which is the rotation of the arm around the X axis.

The problem we get to now is one of priority. If we remove some of the shoulder's influence from the shoulder joint to make this pose look good, another pose will look wrong because the weights are then different. We wind up continually altering weights to fix one pose and then having to redo weights on another.

What you have to do is decide which poses the arm will be in for the majority of the time and concentrate on these. For the others, you can get away with the odd pinch or crease because these poses are not seen very often.

TIP

The character's texture can play a role in disguising areas that don't deform well. Using darker areas will hide any pinching in the geometry; areas that are lighter or include lots of detail serve to highlight creases and areas that stretch.


The twist pose will be the lowest priority for Kila, so let's see how it looks.

1.

Put the arm back into its default pose and, following Figure 14.7, rotate it forward around the X axis. Try to match your own arm's boundaries when it's rotated like this.

Figure 14.7. Rotate the arm forward around the X axis.


2.

Judging by how things look in Figure 14.8, the front and back are acceptable. This is a low-priority pose, so we can leave it as is.

Figure 14.8. The shoulder looks fine with this rotation.


3.

Next, rotate the shoulder the other way around the X axis. As you can see in Figure 14.9, this time the back looks fine but we have a nasty crease at the front.

Figure 14.9. Rotated the other way, the shoulder shows a crease at the front.


4.

To reduce this crease, first smooth the weights around it. Don't get carried away, though; this smoothing will affect the shoulder when it adopts other poses.

5.

Notice that the edge highlighted in Figure 14.10, middle, is the major cause of the crease: It is flipped the wrong way. Select this and delete it; then delete the same edge on the opposite shoulder.

Figure 14.10. Smooth out the weights and delete the offending edge.


Now the shoulder should look pretty good in the major poses. Before you move on to the elbow, rotate the shoulder around and double-check all the weighting.

Elbows

The elbow is slightly easier than the shoulder to weight because it only rotates around one axis.

1.

Raise the arm to make the elbow easier to edit. Then rotate the elbow joint around the Y axis (Figure 14.11).

Figure 14.11. Raise the arm, and rotate the elbow around the Y axis.


2.

Set the vertices below the elbow (Figure 14.12a) to be fully influenced by the elbow. Next, set the Paint Weights Value to 0 and paint on the vertices above the elbow (Figure 14.12b), removing its influence.

Figure 14.12. Adjust the weighting on her elbow.


3.

Now set Value to 1 and Brush Opacity to 0.10. With a soft brush, work on the elbow area, filling out the pinch that currently exists.

You can see the final elbow in Figures 14.12c and 14.12d.

NOTE

It's important to realize that you will not get every joint to deform realistically. We are limited to the geometry and the skeleton that we use to deform it, so all we can do is work toward the best possible result. With joint and polygon restrictions, you won't get the character to deform perfectly in all situations.


Wrist

We've arrived at the wrist. Like the shoulder, it needs all degrees of freedom weighted correctly, but here the weight painting is pretty straightforward.

Again we have to think about priority when working on the wrist. We can achieve a good bend when the wrist rotates around the Y axis or Z axis, but this is at the sacrifice of the X rotation, which makes the wrist twist. Think about what actions your character is most likely to do moreif they are holding weapons, the Y and Z rotations will more likely take priority; but if the character's actions cause the wrist to twist a lot, then the X rotation will have to offer better deformation.

First, rotate the wrist around the Y and X axes to see how it deforms. You will no doubt notice that the geometry moves with the action in a way that makes the wrist appear to bend unnaturally. This is because the weights are evenly distributed between the forearm and wrist joints. We now need to lock some of these weights down.

1.

Select the mesh and open the Paint Skin Weights window. Set Opacity to 1 and Value to 0, and select L_Wrist in the Influence pane.

2.

Paint the vertices just above the wrist, removing the wrist joint's influence (Figure 14.13, middle). Then make sure the vertices immediately below the wrist are fully weighted to it (Figure 14.13, right).

Figure 14.13. Change the priorities of the weighting around her wrist.


Now the hand will move quite nicely up and down, left and rightbut look at what happens when you twist it (Figure 14.14). You get quite a bad deformation around the wrist area.

Figure 14.14. The wrist deforms badly when twisted.


In a real arm, the wrist doesn't actually twist around the wrist joint. Instead, it's the ulna and radius bones in our forearm that twist around each other, making the hand seem to rotate. To implement this properly into our character would involve adding an extra joint halfway up the forearm; we didn't include this in our rig because we required a simpler setup.

Many studio's add gloves or long sleeves to their character designs, which can disguise the twist of the wrist. This usually works well, because the hand is essentially detached from the arm and the wrist is hidden beneath the sleeve or glove.

The only solution we have is to continue to pose the hand and edit the weights until we reach a satisfactory result. So let's leave the wrist as is and look at what we can do with the hand and fingers.

Hand Weights

We will skip the main palm area until the fingers are done, since these are more important to get right. After the main finger weights in place, we can then go in and make any minor alterations to the palm.

If the geometry making up the fingers doesn't deform correctly, the hands will not work visually. The best approach is to work on the fingers one at a time.

1.

Select the icon for the index finger. Set the Proximal_Pitch, Middle_Pitch, and Distil_Pitch to 5.

With a single finger bent, you can now see how the weights have been distributed. As you can see in Figures 14.15a and 14.15b, the index finger's joints are affecting the middle finger's geometry.

Figure 14.15. Paint the individual sections of the finger.


2.

Paint the main area of this section of finger so it is fully influenced by the joint (Figure 14.15c), and remove any influence it has over any neighboring fingers. Do this by reducing Paint Weights Value to 0 for this task.

Then change Value to 0.5 and paint over the vertices that lie down the middle of the knuckle, making it half influence both sections of the finger.

3.

Move to the next joint, L_Index_B, and repeat step 2. Fully weight the section to the joint, while removing any outside influence. Then make the center knuckle vertices influenced by both the L_Index_A and L_Index_B joints.

4.

Now work on the tip of the finger. Weight it fully to the L_Index_C joint, removing any influence it has over the middle finger.

5.

To finish, set Opacity to a smaller value, select a soft brush, and work on the base of the digit, underneath where it meets the palm. Try to get the finger to pinch less as it bends.

As shown in Figure 14.15d, the main finger is now weighted correctly.

Repeat these steps for the other three fingers and the thumb. First bend the finger, then work on each section until the weighting is correct and doesn't influence any of the other digits.

NOTE

This procedure will obviously be different if you are using the lower-resolution hands that may have fewer fingers. Just make sure that each section is fully weighted to the joint that rotates it.


Now when you bend all the fingers, they should deform correctly without moving any of their neighboring fingers (Figure 14.16).

Figure 14.16. The fingers now deform correctly.


The final stage for the hands is to weight the palm area so it is almost completely controlled by the wrist joint (Figure 14.17). This will also help you to fill out the base area of the fingers if they are pinching.

Figure 14.17. Weight the palm area to the wrist.


Leg and Waist Weights

For the legs, it is best to begin at the top in the waist area, because the hip can rotate in a number of directions. When that is done, we can address the knee, ankle, and finally the foot.

1.

To start, move the foot icon as demonstrated in Figure 14.18, first out in front of the leg, then up, and finally out to the side. You will also need to move the knee position icon, or the leg will flip and the knee will point backward.

Figure 14.18. Position the leg and knee to see how they deform.


2.

Now focus in on her left hip. Begin by editing the weights for the Root joint. As you can see in Figure 14.19, left, the weights are distributed quite softly in this area, making it quite flexible and squashy. You need to lock down some of the weights, making the hips look more solid when she moves.

Figure 14.19. Fully weight her left hip area to the Root joint.


3.

Set both Opacity and Value to 1, and paint around the main hip area with the solid brush. Also paint around the back of the hip, under her crotch, and the belt. Paint only on her left side (Figures 14.19b and 14.19c).

Now that we have the main hip area locked, we can go in and work on the rest of the vertices, smoothing out the general area while also removing any pinches or creases. To help with this, we will first edit the weights on her thigh. At present, this is partially weighted to the Root joint, causing it to flatten as she raises her leg. Fixing this now will help show us exactly what we need to do to complete the hip.

1.

Fully weight the main bulk of her thigh to the left thigh joint, painting over the vertices highlighted in Figure 14.20, left. The thigh should literally pop out, back into its original form (Figure 14.20, right). This means we can go back and tackle the rest of her hip.

Figure 14.20. Correct the weights on her thigh.


2.

Still focusing on the L_Thigh joint, select a softer brush. Then paint around her buttock, softening the curve and averaging out the distance between the vertices (Figure 14.21, left).

Figure 14.21. Tweak the weights around her hip.


3.

Next, work on the front of her thigh. In this area, try to reduce the amount of pinching that occurs. Removing it completely will be nearly impossible, so just make it less obvious by closing any large gaps in the geometry (Figure 14.21, right).

Finally, be sure to remove any influence the left thigh has over the right.

We have now corrected the hip in one position, but it also rotates backward and out to the side. Move the foot icon back, so the leg resembles that in Figure 14.22.

Figure 14.22. Move the foot back to see how the hip deforms from a different position.


Check to see how the front and back of the thigh look. In Figure 14.23, left, the front looks fine. Maybe a little bit of tweaking is needed to straighten out her sash, but there are no major problems. The rear will need a bit more work. In Figure 14.23b we can see that there is a sharp polygon sticking up; that will need to be fixed.

1.

Open the Paint Skin Weights tool; you should still have all your previous settings stored, so edit the front and rear of her hip until the weights resemble those in Figure 14.24.

Figure 14.24. The edited front and rear weights


2.

Now recheck how the hip looks with the leg bent forward. Make any minor tweaks needed, before moving it out to the side (Figure 14.25) so we can test the final position. The weights on the hip should really look fine in this pose. If you do need to make any adjustments, it will only be to the side.

Figure 14.25. Move the leg out to the side to test the final pose.


Figure 14.23. The front weights look fine, but the rear needs work.


Now move the leg around and double-check each position, making sure the hip looks as good as it can before we work on the knee.

As we did earlier with the thigh, we need the lower leg to maintain its volume as it moves. Right now the thigh joint affects it, so we need to remove this influence first.

1.

With the L_Thigh joint still active, set Value to 0 and Opacity to 1 before painting the lower section of her leg (Figure 14.26, middle).

Figure 14.26. Adjust the weights on the lower leg and knee.


2.

Tweak the weights around the knee (Figure 14.26, right) trying to smooth out any harsh lines.

That's the knee area more or less complete now; we have adjusted all the weights we need to by just using the L_Thigh joint.

NOTE

Don't be discouraged about areas that intersect when they deform, like the knee and thigh, upper arm and lower arm, and so forth. This happens all the time in video gamesunfortunately, it's the only way to allow the limbs to keep their shape and achieve the most realistic and lifelike deformations. Once the character is in game and running around, you probably won't even notice these little flaws.


Now let's look at the base of her leg and the foot.

1.

First reset the position of the leg. Then rotate the foot so it is pointing downward, before using the Toe_Rotate attribute to point the toe upward (Figure 14.27).

Figure 14.27. Pose the foot to see how the weights are distributed.


Although things in this area may initially look all right, the main foot area's weights are distributed between three jointsthe ankle, toe, and tipmaking it flatten as the foot rotates. Let's fix this, weighting the main bulk of the foot to one joint, the ankle joint.

2.

Highlighting L_Ankle as the joint to edit, fully weight the heel of the shoe and the lower part of the jeans to this L_Ankle joint (Figure 14.28, right).

Figure 14.28. Set the ankle to fully influence her heel and lower jeans.


3.

In the Paint Weights pane, select the Smooth paint operation to smooth out the lower section of jeans, but don't paint over the very bottom since this needs to stay locked to her shoe.

As a final test, rotate the foot into a few different poses to see how the jeans deform. As you can see in Figure 14.29, the folds in the jeans compress nicely and work quite well, so there is no need to do any further work on this area.

Figure 14.29. Test the lower leg's deformation in other poses.


The waist, leg, and foot have now had their weighting reworked and should now deform correctly when Kila is animated. Try putting the leg into some different poses to see how different areas deform, making any changes you need before you proceed.

Head and Neck Weights

Before we move into this section's steps for the head and neck weights, let's make sure we have the face all set. Regardless of which version of the character you are working on, the face area will have already been weighted, either earlier in this chapter (for blend shapes) or in Chapter 13 (for joint-based).

The blend-shapes face is already a separate object, meaning we can't accidentally edit its weighting. Be careful on the joint-based face, though, since the weights can easily be damaged.

If you are working on the blend-shapes model, make sure the vertices around the face are fully weighted to the head joint. The face geometry's weighting is fine, but because it's a separate object we need to guard against tearing around the edges where it joins to the body mesh. To do this, work on the body geometry, fully weighting the vertices around the face to the head joint.

In the joint-based version, make sure all but the face is fully weighted to the head joint. You can do the hair for now, if you want; just make sure not to touch the face's weights.

You can see both versions of the head in Figure 14.30. The joint-based Kila is on the left, and the blend-shapes version is on the right.

Figure 14.30. Fully weight the head and hair to the head joint, but leave the face as is.


This preparation leaves the neck, shoulders, and the outer areas of her head to work on. We will need the head icons visible, so turn the left icons off and the middle icons on. Now we can proceed to look at the neck and shoulders.

First of all, the hair joints will be affecting the neck and the top of the shoulders. Since the hair geometry is at present controlled by the head, we can safely remove its influence from the model and reapply it to just the hair later.

1.

In the Paint Skin Weights window, set Value to 0 and Opacity to 1, and select Hair_A as the joint to work on.

2.

Instead of painting on the model to remove the influence, click on the Flood button at the bottom of the Paint Weights pane. This applies the current settings to the entire model, so in this case Hair_A will have a value of 0 on every vertex. In other words, this joint won't be affecting any vertices in the model.

3.

Next, select Hair_B and click on Flood, and then do the same for the other three hair joints, to make sure none of them influences the neck or shoulders.

With that done we can now work on the necks weights.

1.

Following Figure 14.31, move the head icon up, exposing the neck and showing you how it currently deforms.

Figure 14.31. Raise the head icon, tilting the head upward.


2.

Edit the weights around the center of her neck so that they are fully weighted to the neck joint.

3.

Use a smaller Opacity setting and work around the upper and lower sections of her neck so that they are evenly influenced.

4.

Check to see that the neck joint affects no other areas on her back or outer shoulders. If it does, you can remove the influence by setting Value to 0 and Opacity to 1 before painting over the vertices.

The final neck weights should resemble those seen in Figure 14.32, right.

Figure 14.32. Edit the neck's weighting.


Check the neck's actual rotation, using the control icon to make sure it deforms correctly, and make any needed alterations to the weights.

Main Body Weights

All that is left in painting Kila's weights is adjusting the weighting on her torso area. After that, we can mirror the weights across to the right side.

The torso is quite easily fixed; you just have to keep the deformation smooth so that the body maintains its overall shape as it moves.

NOTE

Be sure to take care when editing the waist area, because we have already applied some weighting to it earlier in this chapter.


1.

Make all the icons visible again and, as demonstrated in Figure 14.33, bend Kila backward a little. Then go in and fully weight the vertices to the joints closest to them.

Figure 14.33. Bend Kila backward so you can weight the torso.


Figure 14.34 shows the weights for the Upperspine (top), Middlespine (middle), and Lowerspine (bottom). As you can see, the weights are like strips around the body. The upper spine joint also includes her chest and the upper parts of her back, right up to the base of her neck.

Figure 14.34. Weight the torso vertices to their closest joints.


With these weights blocked in, we can now test the torso in other poses.

2.

First, using the spine icons, rotate her so she is bent forward (Figure 14.35). As you can see, we have some pinching and bad deformation on the front. Tackle this by using a smaller Opacity value and a softer brush to adjust the weights. When you're done, go in with the Smooth paint operation and smooth out any harsh edges, averaging out the vertices.

Figure 14.35. Bend Kila forward to test her torso deformation.


TIP

To help keep the shape of Kila's stomach, try adjusting the weights so that the Root joint has more influence on the vertices that form the inside of her crop top.

3.

Reset the spine back to its default position. Then rotate it around the Y axis this time, as shown in Figure 14.36. The twist should initially be fine; if there are any areas that don't appear to twist nicely, go in with the Smooth tool and a small Opacity value and paint over the area.

Figure 14.36. Twist the spine around the Y axis.


4.

Finally, test how she looks when bent over to the side, around the Z axis (Figure 14.37). This position, too, should be fine, although you may need to weight the actual hip area to the Root joint more, to prevent it from moving inward.

Figure 14.37. Twist the spine around the Z axis.


You've got the main torso area complete now. Before we move on to do her chest, it's a good idea to test the shoulders' deformation when the clavicle controls are moved.

Move the left clavicle control up slightly and see how the shoulder looks. As shown in Figure 14.38, left, the main shoulder moves up fine, but the area just at the neck stays where it is, causing an unnatural indentation. With Value set to 1 and Opacity set to a small value, gently paint over the area between the neck and shoulder, bringing it up in line with the shoulder's position (Figure 14.38, middle).

Figure 14.38. Adjust the shoulder so that it deforms correctly when the clavicle control is moved.


Now that the main torso is complete, we will reinstate the controls for her breasts.

1.

As demonstrated in Figure 14.39, left, move the LeftBreast controller up. This won't affect the actual geometry because the vertices making up her chest are fully influenced by the upper spine joint.

Figure 14.39. To finish the torso, add weighting back to her breast.


2.

Go back into the Paint Skin Weights tool and select the L_Breast joint. Set Opacity to around 0.3. You can see that there is currently no influence because the mesh remains black (Figure 14.39, middle).

3.

Now work your way around her left breast, starting from the center and working your way outward. What we want is for the middle to be more or less fully controlled by the joint, with the influence fading as it moves away from the joint itself (Figure 14.39, right).

4.

Make sure to add a slight influence to her crop top as well.

The main body area is completethat is, her entire left side is finished. It's time to mirror the weights.

NOTE

You may have noticed that the hair area is not yet properly weighted. We want to mirror the weights first, before finishing the hair, because her hair is not symmetrical; that means the weights will not mirror properly in that area. We can, however, adjust these weights afterward.


Mirroring Weights

With one side of Kila completely weighted, we can now save ourselves a lot of work by copying the weights across to the right side of the body.

Before you begin, make sure she is back in her default pose so that Maya can tell which joints it is copying from and to. Also, if you are using the joint-based facial rig, move the Time Slider to frame 1, separating the eyelid joints.

1.

Select the character mesh. Go to Skin > Edit Smooth Skin > Mirror Skin Weights and open the options (Figure 14.40).

Figure 14.40. Mirror Skin Weights options


2.

The way Kila is placed in the virtual world means her arms span the X axis. Therefore, you need to mirror the weights across the Y and Z axes, so set Mirror Across to YZ.

3.

Her left side lies in the positive section of the axis, but her right side is in the negative. Because you are mirroring from the left, enable Direction Positive to Negative so that Maya knows which side to mirror from and to.

4.

Click on Apply, and the weighting information will be copied across.

Maya's Mirror Weights tool doesn't always do a perfect job; the weighting tends to get confused down the center of the model, and often weights are assigned incorrectly. You may find, for example, that the vertices down the center of her T-shirt move with the right breast but not with the left. These kinds of problems will need fixing before you move on; make sure that each side equally affects the vertices in between.

Other areas to check include the crotch, which needs to stay fixed to the Root joint. The upper spine and even the base of her neck may need to be corrected, too.

Look also at areas such as her belt, which isn't symmetrical. This lies across an area that dramatically deforms, so it will be impossible for the belt not to intersect with the mesh at some point; just try for the best result you can get.

TIP

The best overall way to check your weighting is to put your character into some extreme poses. These will reveal any faults in the way the weights are distributed. You can then go in with a lower Opacity setting and tweak the weighting values until they are correct.


With the main body-weighting mirrored we can now move on and work on her hair.



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

    Similar book on Amazon

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