Shape keys and hooks are great ways to deform a mesh, but the problem with them is that both are lacking a good underlying structure. They're great for big, cartoony stretching and deformation, but for a more structured deformation, like an arm bending at the elbow joint, the motion that they produce is pretty unnatural looking. To solve this problem, 3D computer animation took a page from one of its meatspace contemporaries, stop-motion animation. Stop-motion animation involves small sculptures that typically feature a metal skeleton underneath them, referred to as an armature. The armature gives the model both structure and a mechanism for making and holding poses. Blender has the same structure and it, too, is called an armature. Armatures form the basis of nearly all Blender rigs.
To add an armature to your scene, go to the 3D View and press Shift+AArmatureSingle Bone. As Figure 11-7 shows, adding an armature creates a single object with a weird shape called an octahedron. Continuing to use the skeleton analogy, that octahedron is referred to as a bone in the armature. The wide end of the bone is referred to as the bone's head or root, and its narrow end is referred to as the bone's tail or tip. Typically, a bone pivots at the head.
You can take a rather inauspicious single bone armature and do something more interesting with it. Like nearly every other object in Blender, you can edit the armature in more detail by selecting it (right-click) and tabbing into Edit mode. In Edit mode, you can select the sphere at the bone's head, the sphere at the bone's tail, and the bone itself. (Selecting the bone body actually also selects both the head and tail spheres as well.)You can add a new bone to your armature in five ways:
Armatures can get very complex very quickly, so you should name your bones as you add them. Let me say that again: Name your bones as you add them. The fastest way to name your bones is from the Item panel in the 3D View's Properties region (N) and edit the names of your bones the same way you edit names of other Blender objects. Left-click the name in the Bone field and type the name of a bone that makes sense. Alternatively, you can go to Bone Properties and change the name of your bone from the text field at the top. As an example, if you have a two-bone chain to control a character's arm, you may name one bone arm_upper and the other arm_lower.
Unfortunately, both these techniques can be really slow if you're trying to name a lot of bones at once (because maybe, ahem, you forgot to name your bones as you were adding them). For this hopefully rare case, the Outliner is the best tool for the job. Expand the Armature object to reveal the hierarchy of bones within it. Ctrl+left-click the name of any bone (or any object, for that matter), and you can rename it right there. Figure 11-8 shows the three places where you can name your bones.
Blender has a pretty cool way of understanding symmetric rigs, or rigs that have a left side that's identical to the right. For these cases, use a .L and .R suffix on your bone names. So in the previous example, if you're rigging a character with two arms, the bones in the left arm would be named arm_upper.L and arm_lower.L. The right arm bones would be named arm_upper.R and arm_lower.R. This naming convention gives you a couple of advantages, but the one that's most apparent when modeling your rig is the X-Axis Mirror feature.
To understand how symmetric rigs and X-axis mirroring work better, create a new armature at the origin (Shift+SCursor to Center, Shift+AArmatureSingle Bone) and follow these steps:
Now, wherever you move the tail of this bone, the tail of Bone.L matches that movement on the other side of the X-axis. You can even extrude (E) a new bone, and a new bone is extruded on both sides of the axis. In this way, X-axis mirroring can speed up the rigging process immensely.
When editing bones, it's a good idea to make visible the mesh for which your rig is intended. This way, you get your proportions correct. A good general rule for placing bones is to think about where the character's real anatomical bones would be located and then use that as a guideline.
One important thing that makes armatures helpful is the notion of how its bones relate to one another. The most important of these relationships is the parent-child relationships between bones. The same hotkeys for parenting and unparenting objects also work with bones, but with a couple additional features. To illustrate the additional features when parenting bones, start a new scene (Ctrl+N), delete the default cube (X), add a new armature object (Shift+AArmatureSingle Bone), and then tab into Edit mode. Then follow these steps:
You're given two options:
You have another pair of options:
Figure 11-9 shows how two bones in an armature can be related.
Even with bones parented — connected or otherwise — if you rotate the parent bone, the child doesn't rotate with it as you might expect in a typical parent-child relationship. That's because you're still in Edit mode, which is designed mostly for building and modifying the armature's structure. The parent-child relationship actually works in a special mode for armatures called Pose mode. You access this mode by pressing Ctrl+Tab. When you're in Pose mode, if you select individual bones and rotate them, their children rotate with them, as you might expect. From there, you can swap back out to Object mode by pressing Ctrl+Tab again, or you can jump back into Edit mode by just pressing Tab. Chapter 12 has more on working in Pose mode.
When working with armatures, the Properties editor has some sections specific to armatures with options and controls that are incredibly helpful. Select your armature (right-click) and have a look at the Properties editor. In particular, note that the Object Data Properties show an icon of a figure, and you see two additional sets of properties: Bone Properties and Bone Constraints Properties. Figure 11-10 shows the contents of these panels.
As you may have guessed, Object Data Properties provide options for the Armature overall, while Bone Properties provide options for the currently selected bone. Looking first at the Bone Properties, some options and controls are immediately helpful. The text field at the top lets you rename your bone. The Transform panel gives you precise numeric control over the location of the head and tail of the selected bone, as well as its roll angle, or the orientation of the octahedron between the head and the tail. These controls are exactly the same as the transform controls in the 3D View's Properties region.
In the Relations panel, you can define how the selected bone relates to other bones in the armature. In particular, the Parent field displays the selected bone's current parent, if it has one, and allows you to choose another existing bone as its parent. If you have a parent defined here, the Connected check box beneath it allows you to tell Blender whether it's connected to its parent.
On the left side of the Relations panel are a series of buttons, known as bone layers, which look like the layers buttons in the 3D View's header. Just as you can place objects on layers in Object mode, Blender's armatures have a special set of layers to themselves. The reason is that character rigs can get pretty involved. Using bone layers is a good way to keep the rig logical and organized. Left-click a layer button to assign the bone to it. If you'd like the bone to live on more than one layer, you can Shift+left-click the buttons for those layers.
The options in the various armature-related sections of the Properties editor change a bit between Edit mode (Tab), Object mode, and Pose mode (Ctrl+Tab). What I cover is available in Edit mode and Pose mode.
Two other important sets of controls are in Bone Properties. The first is the Deform panel. Simply put, the check box for this panel is a toggle that tells Blender whether the selected bone can be mapped to the geometry of your mesh. If it is mapped, or weighted, to the mesh, then that bone is considered a deformer. Deformers should have the Deform check box in Bone Properties enabled. Besides deformers, you can also have bones whose purpose is to control the behavior of the deformer bones. These bones are often referred to as control bones. To prevent the control bones from inadvertently influencing your mesh's geometry, you want to make sure that the Deform check box is disabled in Bone Properties.
Back in Object Data Properties, two sets of layer buttons appear in the Skeleton panel. These buttons correspond to the bone layers in Bone Properties. The layer buttons under the Layers label control which layers the armature is actually displaying in the 3D View. The layer buttons under the Protected Layers label have an effect only if you're linking your rig into a separate scene file. That topic is a bit more advanced than what this book covers, so I leave it at that for now.
One option I like to enable in this panel is the Quaternion check box. This option is more relevant after you begin animating with your rig, but enabling it makes the armature deform the mesh assigned to it a lot more cleanly than if it's disabled. Occasionally, enabling the Quaternion check box can cause deformation artifacts in your character mesh, but that is usually pretty rare.
The Display panel contains a set of buttons for controlling how bones in the armature are displayed:
Armatures and bones are pretty interesting, but they do you no good if they don't actually deform your mesh. When you create your own rig, and Ctrl+Tab to Pose mode, you can grab, rotate, and scale bones, but the moving bones have no influence whatsoever on your mesh. What you need to do is bind the vertices of the mesh to specific bones in your armature. This binding process is commonly referred to as skinning. Blender has two primary ways of skinning: envelopes and vertex groups.
Envelopes are the quickest way to get a mesh's vertices to be controlled by the armature. You don't have to create anything extra: It's just a simple parenting operation that seals the deal. To use envelopes to control your mesh, use the following steps:
Choose Armature Deform from the menu that appears. Upon completion, your mesh is a child of the armature object, and it also now has an Armature modifier applied. The modifier is what allows the armature to deform your mesh. Without the modifier, it's just a simple parenting.
When you Ctrl+Tab into Pose mode on your armature, the mesh is now under its influence.
This step reveals exactly where the influence of your envelopes lies.
(Actually, if you just want to edit the influence, you can do so directly with the Ctrl+Alt+S hotkey combination.)
Figure 11-12 illustrates envelopes in action.
Envelopes are great for quickly roughing out a rig and testing it on your mesh, but for detailed deformations, they aren't ideal. Where the influence of multiple envelopes overlap can be particularly problematic, and there's a good tendency for envelope-based rigs to have characters pinch a bit at their joints. For these cases, a more detailed approach is necessary.
That said, using envelopes in your armature does give you one distinct control that you can't have with armatures otherwise. You can actually use an armature with envelopes to control the deformation of curves and surfaces. So long as a control point is within the influence space of a bone's envelope, you can modify it and therefore animate it with the armature.
So if envelopes are the imprecise way of controlling your mesh, what's the precise way? The answer is vertex groups. A vertex group is basically what it sounds like — a set of vertices that have been assigned to a named group.
In many ways, a vertex group is a lot like a material slot (see Chapter 7). Besides the fact that vertex groups don't deal with materials, vertex groups have a couple of distinctions that set them apart from material slots. First of all, vertex groups aren't mutually exclusive. Any vertex may belong to any number of vertex groups that you define.
The other distinction is that you can give a vertex a weight, or a numerical value that indicates how much that particular vertex is influenced or dedicated to the vertex group. A weight of 1.0 means that the vertex is fully dedicated to that group, whereas a weight of 0 means that although the vertex is technically part of the group, it may as well not be.
One thing to note: Vertex groups need to have the exact name of the bones that control them. So if you have a bone called pelvis, you need a corresponding vertex group with the same name. The vertices assigned to that group then have their position influenced by the location, rotation, and scale of the pelvis bone, tempered by the vertices' individual weights.
To adjust the assignments and weights of vertices in their respective vertex groups, you can use the Vertex Groups panel in Object Data Properties for your selected mesh. You create a new group with the Plus (+) button to the right of the list box. To select the vertices that you want to assign to the group, you need to tab into Edit mode. With the vertices selected in Edit mode, you can adjust the value in the Weight slider and then assign them to the vertex group by left-clicking the Assign button.
If you don't see the Assign button or Weight slider in the Vertex Groups panel, then you're not in Edit mode. Tab into Edit mode and those controls should appear for you.
Something to note about vertex weights is that, when used for armatures, they are normalized to 1.000. That is, a vertex can be a member of two vertex groups and have a weight of 1.000 for both. In these cases, Blender adjusts the weights internally so that they add up to 1.000. So in my example, that double-grouped vertex behaves like it has a weight of 0.500 on both groups.
Of course, on a complex armature, this process of creating vertex groups and painstakingly assigning weights to each vertex can get excessively tedious. Fortunately, Blender has a couple tools to make things less painful. First of all, you don't have to create all the vertex groups by yourself. Refer to the preceding section on the process of skinning with envelopes. By parenting the mesh to the armature there, you're presented with a few options. For using envelopes only, you choose Ctrl+PArmature Deform. However, the other options give you a lot of power when you use vertex groups:
Regardless of which option you choose, you'll probably still have to go in and manually tweak the weights of the vertices in each vertex group. Trying to do those tweaks just from the Vertex Groups panel can be pretty painful. Fortunately, there is Weight Paint mode. This mode is almost exactly like Vertex Paint mode (see Chapter 7), except that rather than painting color on the mesh, you're painting the weight assignment to a specified vertex group.
To access Weight Paint mode, select the mesh (right-click) and press Ctrl+Tab. Alternatively, you can choose Weight Paint mode from the Mode menu in the 3D View's header. Even if you don't intend to paint weights, Weight Paint mode is a great way to see how the weights were assigned by Blender if you used the automatic method.
The way that weights are visualized is kind of like a thermal map where red is the hottest value and blue is the coldest value. Extending this logic to work with bone weights, vertices that are painted red have a weight of 1.0, whereas vertices painted blue are either not assigned to the vertex group or have a weight of zero. The 50 percent weight color is bright green.
If the thermal map color styling isn't your thing (as can be the case if you're colorblind), you can define your own weight paint color range using the ramp editor in the bottom right of the System section of Blender's User Preferences (Ctrl+Alt+U). When in Weight Paint mode, you get a bunch of painting panels in the Tool Shelf, as shown in Figure 11-13. With a few minor exceptions, these controls are identical to the ones used in Vertex Paint mode.
When weight painting, it's often useful to enable the Wire check box in the Display panel of Object Properties. Enabling this check box overlays the mesh's wireframe on it. Seeing the wireframe is especially helpful when weight painting because it helps you see where the actual vertices on the mesh are. That way, you're not just painting in empty space where no vertices exist. The only slight hiccup is if you're painting planar vertices, or vertices that all share the same plane. In this particular case, Blender tries to simplify the wireframe overlay. While that simplification may be nice in general, it can be problematic when painting. To get around that obstacle, enable the All Edges check box in the Display panel in the 3D View's Properties region (N).
A handy feature in the Tool Shelf while weight painting is the X-Mirror check box in the Options panel. X-Mirror can literally cut your weight painting time in half. When you enable this check box, Blender takes advantage of the left/right naming convention discussed earlier in the “Editing armatures” section of this chapter. So if you're tweaking the vertex weights on the left leg, Blender automatically updates the weights for the corresponding bone on the right leg so that they match. If that ain't cool, I don't know what is.
The actual process of weight painting is nearly identical to using vertex paint. However, you need to pay attention to one more thing with weight painting: the need to tell Blender which vertex group you're painting. You can do so in two ways. The slow way, you already know: Select the group from the list box in the Vertex Groups panel in your mesh's Object Data Properties.
Of course, the kind Blender developers have provided a faster way: Select (right-click) the bone that you want to paint weights for, and Blender automatically activates the corresponding vertex group and allows you to paint. As an added bonus, you can test your weights on the fly by grabbing, rotating, or scaling the selected bone while you're still in Weight Paint mode.
Because weight paint relies so much on color, I highly recommend you look at the full-color version of a simple mesh in Weight Paint mode in this book's color insert.
If you choose to use vertex groups, you have something else to decide. Have a look at the Armature modifier on your mesh. Under the Bind To label are two check boxes: Vertex Groups and Bone Envelopes. With both enabled, the mesh is influenced by both vertex groups, as well as the bone envelopes from your armature. This double influence can be useful in some instances, but I tend to prefer to work with just one or the other. And if I create vertex groups and assign weights to vertices, I generally disable the Bone Envelopes check box. Your rigging needs may be different, but this setup works for me because this way I know that the only reason a vertex is deforming improperly is that I didn't assign its weight properly. I don't have to concern myself with the influence of the bone's envelope.