From BlenderWiki

Jump to: navigation, search

Weight Paint mode

We're going to tell Blender which vertices in the mesh to move whenever we move a bone in the armature. While we could manually choose vertices and assign them to groups, a more powerful way to do this is with Weight Paint mode.

Change the armature draw type to Stick.
Armature in Stick draw type.
  • First, let's make the bones a little less obtrusive. Select the armature.
  • In the Armature panel under the Edit buttons, choose Stick as the draw type. This changes the bones from bulky octahedrons (which are a useful shape for building armatures) into thin sticks that don't take up as much space on the screen.


Note
In order to select bones in the armature while weight painting, the armature has to be in Pose mode.


  • Make sure the armature is in Pose mode.
  • Select the character mesh.
  • Switch to the mesh's Weight Paint mode with Ctrl⇆ Tab. Similar to Pose mode for armatures, we've substituted Weight Paint mode for Object mode.

Notice the mesh turns dark blue. As you'll see, weight painting uses colors to represent information about groups of vertices.

Character mesh, in Object mode.
Character mesh, in Weight Paint mode.


The Paint panel.
  • In the Edit buttons a new panel is now available: the Paint panel. Make the following settings:
    • Change Weight to 1.0. This determines the color of the brush.
    • Change Opacity to 1.0. This is how much "paint" is applied with each brush stroke.
    • Turn off All Faces. This gives us a little more control over what gets painted.
    • Turn off Vertex Dist. This will also give us more control.
    • Leave Soft on, but this is mostly personal preference. For what we're doing, it just makes the painting look a little smoother.
    • Important: Turn X-Mirror on. This will let us take advantage of our symmetrically-named bones, so we'll only have to paint one side! (User Addendum [not the author]: In my case, this caused the mirrored bone to move in pose mode, even with only the first bone selected. I had to paint the bones individually, leaving X-Mirror off, in order to move only one bone at a time. I may have made a mistake somewhere along the line, but I couldn't find it. If you encounter this problem, you may want to paint bones individually and leave X-Mirror off.)


The Weight in weight painting refers to the strength of a bone's influence. With the upper_arm.l bone selected, we want the vertices in the upper arm of the mesh to be influenced. So we paint them!

Weight painting the upper arm

upper_arm.l selected while in the mesh's Weight paint mode.
  • Select the upper_arm.l bone with RMB Template-RMB.png. Even though we're in the mesh's weight paint mode, we can still select bones because we told the mesh we're going to be using this armature using the Armature modifier.


Weight painting vertices for upper_arm.l, from Front view.
  • Using LMB Template-LMB.png, carefully paint over the the upper_arm.l bone with the brush. The mesh now appears red, indicating those vertices have a weight of 1.0 when it comes to being affected by upper_arm.l. Other colors indicate other weights, but for the purposes of this tutorial we will use all weights of 1.0.


Weight painting vertices for upper_arm.l, from Rear view.
  • Rotate the view to get a good look at the back of the mesh. Ctrl1 NumPad is a quick way to do this (Rear view). Paint the back side of upper_arm.l as well.


Rotating upper_arm.l: the mesh move along.
  • Select the upper_arm.l bone and rotate it (R). The mesh deforms along with the bone.


upper_arm.l selected.
  • Select upper_arm.r on the other side. Notice the vertices for this bone are already painted! That's because we named the bones symmetrically (l and r) and enabled X-Mirror in the Paint panel. Blender found the bone on the other side and mirrored the weights for us.


  • Select upper_arm.l again and clear its rotation with AltR.

Tips for weight painting

Here are some tips to keep in mind while weight painting.

  • The vertices you paint will be assigned to the bone you have selected.
  • Make sure you paint over only the vertices you want to move with the bone you have selected. A little bit bleeding over into an adjacent bone's area may be OK.
  • If you make a mistake, CtrlZ only undoes the last step, not multiple steps. I find that the best way is to press the Clear button in the Paint panel. This clears all weights for the selected bone. Important: Clearing the weights does NOT happen symmetrically! If you aren't happy with upper_arm.l and clear it to start over on that bone, you have to select upper_arm.r and clear the weights on that bone as well. Otherwise you'll end up with residual weights on upper_arm.r that will make things asymmetrical.
  • It doesn't matter if your weights don't look exactly like those pictured here, as long as you're happy with the resulting deformation of the mesh when you move the bones around.

Weight paint the rest of the arms

  • Select lower_arm.l and weight paint it. Don't forget to rotate around to the other side of the mesh to paint the back of the lower arm as well.
  • Continue on down to the hand and finger bones, first selecting the bone and then weight painting from the front and back.


Weights for lower_arm.l.
Weights for hand.l.
Weights for finger1.l.
Weights for finger2.l.


If you make a mistake
If you make a mistake while weight painting, CtrlZ only undoes one step. The most straightforward way to fix a mistake is to reset the weights for the bone you have selected by pressing Clear in the Paint panel, and redo the weights for that bone.


The arms now move!.
  • Now select the finger2 bones and move them. If Auto-IK is enabled, the arms should move along with them. Auto-IK is a property of the armature, so if it's not enabled, you have to switch to Object mode, select the armature, and turn on Auto-IK.


Arm isn't deforming correctly.

Sometimes you'll miss painting a vertex at all. When you go to move the bones, you might see something like this:

Select the bone . . .

To correct it, select the bone that should move those vertices . . .

And paint the offending vertices.

and then paint the uncooperative vertices. They should snap back into place where they should be.

Depending on how you modeled your character, it may take some playing around with in Weight Paint mode to get the bones to deform the character correctly.

  • To reset the bone rotation and location, we have to exit out of Weight Paint mode with Ctrl⇆ Tab
  • Then select the armature.
  • Use the A-A-AltG-AltR combination to clear the location and rotation of all bones.
  • Re-select the character mesh.
  • Switch back to Weight Paint mode (Ctrl⇆ Tab, with the armature reset to rest position.

Weight painting the head and torso

Now let's weight paint the head and torso.

  • Switch to Weight Paint mode for the character mesh.
  • Select the head bone.
  • Paint away! Don't forget the front and back.
Moving the head bone back.
  • With the head bone still selected, move it backward in Side view with G. Whoa! What's going on?
  • By moving the head, we're able to see that we missed some vertices. It turns out that these are the vertices on the inside of the head that we couldn't see before: the inner faces of the eye sockets, and the inside of the mouth.


Paint over the vertices left behind after the head was moved.
  • To fix this, with the head bone still selected just paint over the left-behind vertices. By the way, don't worry about the eyes yet. We'll fix that momentarily.
  • Reset the bones (Ctrl⇆ Tab, select armature, A-A-AltG-AltR).
  • Go back to Weight Paint mode of the character mesh.


Select the spine bones and the neck bone, and start weight painting.

My weights looked like this:

neck weights.
shoulder.l weights.
spine5 weights.


spine4 weights.
spine3 weights.
spine2 weights.


spine1 weights.


Parenting the eyes to the head bone

When we moved the head, the eyes were getting left behind. We couldn't weight paint them to the head bone while we were weight painting the body mesh, because the eyes are separate mesh objects.

It's possible to apply an Armature modifier to the eyes, select the head bone, and weight paint the eyes to the head bone. However, this isn't the best way to do it.

Here's why: We're going to eventually make the eyes track a target. To do so, they need to swivel around their object centers. If we weight painted the eyes to the head, when we moved the head it would pull the eye vertices away from the object center, making the eye tracking all funky.

Instead, we'll parent the entire eye object to the head bone -- not just its component vertices.

Parenting the left eye to the head bone.
  • Switch out of Weight Paint mode.
  • Make sure the armature is in Pose mode.
  • Select one of the eyes.
  • With the eye still selected, shift-select the head bone.
  • Parent the eye to the head bone with CtrlP>>Bone.

Do the same thing with the other eye:

  • Select the eye
  • Shift-select the head bone.
  • CtrlP>>Bone to parent to the head bone.

Now try moving or rotating the head. The eyes should follow along now.

Testing the rig

All right! Switch out of Weight Paint mode, and select the armature. You can now pose your character! Try out some test poses and test renders to play around with your new creation!

Very handy tip
So far, we've been using R to rotate. Try hitting R-R (hit it twice in a row). This enables trackball rotation, and makes positioning bones much easier than regular old rotation.


It'll probably take some practice to get used to the controls. Try these different methods of moving bones to see how they react differently:

  • Turn Auto-IK ON.
  • Select a bone and move it
  • Select a bone and rotate it. Notice how Auto-IK only kicks in when you move, but not when you rotate.
  • Turn Auto-IK OFF
  • Select a bone and move it
  • Select a bone and rotate it. Notice they do the same thing, EXCEPT when you try to move the upper arm. Moving the upper arm detaches it from the shoulder. Well, that's easy to fix: don't move the upper arm, just rotate it!


Test render.


Summary
By weight painting, we told Blender which vertices to move when we moved the bones. The character finally moves! Next, we'll build the lower body armature and do some more weight painting.



You can download the .blend file up to this point: Media:BSoD-ItCA-upper_body_weight_paint.blend.

Next: Lower body: armature and weight painting

Previous: Upper body: armature

Back to Index