How to Create Your First Character Rig in Blender: Part 2 - Weight Painting
In the previous rigging article, I walked you through the process of setting up the armature in Blender. We've learned how to setup all the bones, and apply an automatic weight so that we can begin posing our character. Of course, like most tools, it's not as easy as clicking the "Automatic Weights" button and you're good to go. It really just gives you a good place to start from, and manual weight painting still needs to be done.
Weight painting, or skinning is the process of manually setting the influence that each bone has on your character mesh. For instance, if you move the elbow, how much influence does it have on the upper arm? In reality, it shouldn't really affect the upper arm much, but the automatic weights feature is Blender's best guess at the influence each bone should have, and that guess is not always correct. Depending on the character model you're using, the automatic weights feature might have done most of the leg work. However, the character model I'm using has clothes, belt, etc. Because of this, most of the deformations I'm getting when posing out the bones don't give me the results I want.
This is where weight painting comes in, so we can ensure that our character is deforming in the most realistic and believable way possible, so let's walk through that process now.
Step 1: Put your Model Through the Ringer
The first step we can take is to really put our model through some rigorous testing. I like to pose the model, and see the resulting deformations. Try to manipulate the rig into some extreme poses, intentionally try to break the mesh, how far can you push the rig before the deformations get all wacky on you?
You can see that it didn't take much, and the mesh is starting to go a little crazy on us, the rotation of the arm has way too much influence on the shoulder area, and is causing the mesh to split. You can't see from the angle in the image, but most of the back of the jacket didn't follow along with the rest of the mesh, so it stayed behind. The legs also have too much influence on the hip area, and is causing a lot of stretching in the belt area.
It may look like the rig is a complete mess...which it kind of is, but no need to panic! Because all of these issues are relatively easy to fix.
Step 2: Weight Painting the Chest Bone
When you're ready to be begin painting the weights it's usually a good idea to apply a very simple animation to the area you're planning on painting. I'm starting with the chest bone, so I select the armature and went into Pose Mode. I turned on automatic keyframe, and I set the active keying to Rotation, I have the bone at its default rotation on frame 1, and I rotated it forward in the X axis at frame 15. It's now easy to see exactly where the issues are occurring on the mesh when I rotate it forward.
With the armature still in Pose Mode, right click the character mesh, and with the mesh selected change the mode to Weight Paint. You should now see that your model turns a blueish color. When you right click a bone, you should see the color change around that bone. For example, with the chest bone selected there is a greenish color around the bone that represents where the influence is. You can tell when something has more or less influence by going off the color, Red means the influence is at one, as an area has less and less influence the color will change, orange is less than red, yellow is less than orange, and then green, then blue. By setting the Weight value to one means you're painting full influence which is in red. With it set to zero it means you're taking away any influence on the mesh.
On the tool shelf you should see the weight paint parameters, the things you want to focus on is the Weight value, the higher this value is, the more influence its going to assign to the mesh, the lower the value is, the less influence. A value of zero means you're taking away influence. Next, you have radius, which adjusts the size of the weight brush.
When you go forward in time where the character is rotated you can see exactly where the issues are, with a high weight value begin painting on the areas that need more influence, like the back of the jacket, and the front of the jacket. This can take a lot of back and forth, of going to the start frame and the end frame to make sure that the character is deforming exactly how you want. You can see in the image above the much better deformations I was able to get especially in the jacket area.
Step 3: Weight Painting the Spine Bone
Now that the chest bone has been properly skinned to the character mesh it's now time to move onto the spine bone. You want to make sure that it's influencing just the lower abdomen and not the belt or hip area.
To get a better view of what you're painting you can press "Z" on your keyboard to turn on wireframe mode so you can see more clearly what's painted and what's not. Also, make sure you have the spine bone selected when you're painting the weights. Again, apply an animation to the spine area so you can see clearly the deformations as the character is moving.
Step 4: Weight Painting the Shoulder Bone
With the torso working how we want we can begin painting the weights on the shoulder. This is the part where it's vital to have your bones named properly, with the suffix "L" for left and "R" for right. When we select the shoulder bone, we want weights to be painted over on the other bone. The shoulder bones are named "shoulder_L" and shoulder_R" When we select one shoulder, Blender knows that we want the weights that we're painted to be transferred to the other shoulder, so we don't have to paint them twice.
Again, we want to apply a small animation to the shoulder bone, so we want keyframe at its default state, and the next with it rotated upward about as far as an animator would need to rotate it.
You can see the final result after doing weight painting on the shoulder in the image above. Play around with establishing the weight values until you find a suitable result, and keep scrubbing the timeline to see how the shoulder deforms as it's being raised.
Step 5: Weight Painting the Upper Arm
The next step is to begin skinning the upper arm bone, however, since we've created an IK system, to determine how it's actually going to move once animated you need to set a few keyframes for the IK bone, and raise the arm up. So just like before add a keyframe with the arm at its default pose, and another with it raised up.
Make sure that when the arm is raised it isn't having an affect on the upper shoulder area, and deforming the jacket. You can see that before I skinned the arm properly there was a lot of pinching going on in the shoulder area and arm pit, now however, it has been smoothed out by adding a little more influence on those areas.
Step 6: Skinning the Legs
So when we first applied the automatic weights, it actually does a sufficient job calculating the weights for areas like the hand, fingers as well as the neck and head. The last thing we want to do is adjust the weight for the legs.
You can see from the image above there is some influence on the right leg, even when we have just the left bone selected, so we need to go in and get rid of this influence by setting the weight value on the brush to 0.
You can see in the image above that I just brushed out the influence on the opposite leg, but I also kept a little bit if influence on the groin area because I still wanted it to have a slight affect as the leg moves.
Step 7: Adjusting the Hip Bone
With the rig properly skinned to the mesh, the next step is to adjust the hip bone. If you were to rotate the hip bone, you'd notice that the entire upper body rotates as well, this isn't really how the hips should move, you want the bone to just influence the hip area.
This can be achieved very easily by selecting the hip bone, duplicating it by pressing Shift+D and rotating 180 degrees so that the bone is flipped opposite of the other.
Now select the original hip bone, shift select the new one, and press Ctrl+P and choose "Keep Offset."
Finally select the spine bone and under the Bone properties uncheck "Inherit Rotation."
When you rotate the duplicated hip bone, the hip should now rotate and behave like hips should, and not affect the rest of the body! Although as you can see if you rotate the hip there needs to be some weight painting done to get better deformation results.
As you can see in the image, I added some influence on the jacket so it moves slightly as the hips rotate.
With the hip bone adjusted we've now finished skinning our rig! So we're almost done. In the next article we'll take the last step and setup animation controls so it will be easier for us to select each bone and begin animating. If you want to learn more about Blender visit the Digital-Tutors library for more Blender tutorials.