Discovering the Tools Used in Rigging - Get Animated - Blender For Dummies (2015)

Blender For Dummies (2015)

Part III

Get Animated

Chapter 11

Discovering the Tools Used in Rigging

In This Chapter

arrow Making shape keys

arrow Taking advantage of hooks

arrow Working with armatures to control characters

When it comes to character animation, a character is often a single seamless mesh. As a single seamless mesh, it's virtually impossible to animate that character with any detailed movement using the object animation techniques in Chapter 10. I mean, you can move the whole character mesh at once from one location to another, but you can't make the character smile or wiggle her toes or even bend her arms. You can break the mesh apart and use a complex set of parenting and constraints, but then you lose its nice seamlessness.

What you really want to do is find ways to animate specific parts of the mesh in a controlled manner without tearing the mesh apart. To do so, you need to create a rig for your character. A rig is an underlying structure for your mesh that allows you to control how it moves. Rigs are an integral part of modern computer animation, and if done well, they make the life of an animator monumentally easier. Think about it like turning your 3D mesh into a remote-control puppet. This chapter explains the various tools and techniques used to create more complex rigs. Then you can create a rig for nearly any object in Blender and have a blast animating it. The website www.blenderbasics.com has an example tutorial that takes you from beginning to end on rigging a simple character.

Creating Shape Keys

Whether you have to animate a character or a tree or a basketball with any detail, it has to deform from its original shape to a new one. If you know what this new shape looks like, you can model it ahead of time.

As an example, say that you have a cartoony character — maybe the head of a certain Blender monkey. You know that you're going to need her eyes to bulge out because, that happens to all cartoon characters' eyes. One way to create this effect in Blender is by creating a shape key, sometimes called a morph target or a blend shape in other programs. A rough outline of the process goes something like this (the next section in this chapter goes into more detail):

1. Start with your original mesh.

2. Edit the vertices of the original mesh without creating new geometry to the new pose you want to use.

In the cartoony character example, you’d model the character's eyes all bulgy. (Yes, bulgy is a real word. I think.)

3. Record this new arrangement of your vertices as a shape key to be used later when you animate.

Creating new shapes

Assuming that you selected an object that supports shape keys (meshes, curves, surfaces, and lattices), you can start adding shape keys in the Shape Keys panel of Object Data Properties (Object Data Properties is the generic name for Mesh Properties, and Curve Properties).

Figure 11-1 shows three different states for the Shape Keys panel. By default, this panel looks pretty innocent and empty with just a list box and a few buttons to the right of it. However, when you left-click the Plus (+) button, a basis shape, or the original shape that other shape keys relate to, is added to the list. Left-clicking the Plus (+) button a second time gives you an additional set of options that control the change from the basis shape to a new one, named Key 1.

image

Figure 11-1: The three different sets of options that the Shape Keys panel can provide you.

The best way to see how to create new shapes is to go through a practical example. Staying with the bug-eyed monkey theme, use Suzanne as your test subject, and follow these steps:

1. Start with the default scene and delete the cube (Ctrl+N, right-click the cube, X).

2. Add Suzanne, give her a Subdivision Surface modifier, and set her smooth (Shift+A ⇒ Mesh ⇒ Monkey, Ctrl+1, Tool Shelf ⇒ Shading ⇒ Smooth).

3. Change to the front view (Numpad 1).

4. Add a shape key (Mesh Properties ⇒ Shape Keys ⇒ Plus [+]).

Your basis shape is created. The other shapes that you create will be relative to this one.

5. Add a second shape key (Mesh Properties ⇒ Shape Keys ⇒ Plus [+]) and rename it, if you want.

The Shape Keys panel looks like the last one in Figure 11-1. You've created Key 1. If you want, you can rename it by double-clicking its name field. I named mine Eye Bulge.

6. In the 3D View, Tab into Edit mode and change the mesh to have bulged eyes.

Make sure that your Eye Bulge shape key is active in the Shape Keys panel before making adjustments. As you modify the mode, be sure that you do not add or remove any geometry in the mesh. You should define the shape by moving around the vertices, edges, and faces you already have. A quick way to make Suzanne's eyes bulge is to move your mouse cursor over each eye and press L to select just the vertices there. Then with proportional editing (O) turned on, scale (S) the eyes.

7. Tab back to Object mode.

Figure 11-2 illustrates this process.

image

Figure 11-2: Creating a bug-eyed shape key for Suzanne.

This process creates two shape keys: Basis and Eye Bulge. With the Eye Bulge shape key selected in the Shape Keys panel, you can use the Value slider to smoothly transition from the Basis shape to the Eye Bulge shape. A value of 0 means that Eye Bulge has no influence and you just have the Basis, whereas a value of 1 means that you're fully at the Eye Bulge shape.

But here's where things get really cool. Notice the Min and Max values at the bottom of the panel, labeled Range. The Min is set to 0.000, and the Max is set to 1.000. Just for kicks, change the Max value to 2.000 and pull the slider all the way to the right. Your bulged eyes grow larger than your actual shape key made them. Now change the Min value to -1.000 and pull the slider to the left. Now Suzanne's eyes pinch in to a point smaller than the Basis pose. Figure 11-3 shows the results of these changes. Adjusting the Min and Max Range values is a great way to provide even more extreme shapes for your characters without having to do any additional shape key modeling. How's that for cool?

image

Figure 11-3: Suzanne with excessively bulged and pinched eyes, just by changing the minimum and maximum values for a single shape key.

Mixing shapes

From this point, you can create additional shape keys for the mesh. Say that you want to have a shape key of Suzanne's mouth getting bigger, like she's screaming because her eyes have gotten so huge. The process is about the same as when creating your initial shapes:

1. Add a new shape key (Mesh Properties ⇒ Shape Keys ⇒ Plus [+]).

Feel free to name this key whatever you want. I called mine Scream.

2. Tab into Edit mode and model the mouth open with the existing vertices.

Make sure that you're not touching Suzanne's eyes. You're just editing the mouth to get bigger.

3. Tab back into Object mode.

Figure 11-4 shows the results of this process.

image

Figure 11-4: Creating a scream shape key.

After you have the Scream shape key created, you can freely mix it with the Eye Bulge shape key, or you can have Suzanne screaming with her regular, bulge-free eyes. The choice is yours. You have the flexibility here to mix and match your shape keys as it pleases you. And animating the mesh to use these keys is really easy.

remember In Blender, “(almost) everything is animatable,” so animating shape keys is as easy as inserting keyframes on the Value slider in the Shape Keys panel. (Right-click the Value field ⇒ Insert Keyframe or hover your mouse over that field and press I.) Now you can scrub the timeline cursor forward in time and watch Suzanne bulge and scream to your complete delight.

To see another nice little bonus, split off a Graph Editor from your 3D View. If you enable the Show Sliders feature in the Graph Editor (View ⇒ Show Sliders), you can see the numeric values for your shape keys' influences and even key them right there.

Knowing where shape keys are helpful

Now, you could do an entire animation using shape keys. But do I recommend it? No. You can control your meshes in other ways that may give you more natural movement for things like animating arms and legs.

That said, shape keys are the perfect choice for things that you can't do with these other means (or, at least, that are very difficult). A big one is facial animation. The way parts of the face wrinkle up and move around is pretty difficult to re-create without modeling those deformations. Furrowed brows, squinty eyes, natural-looking smiles, and phonemes, or mouth shapes for lip-syncing, are where shape keys shine. You can also team them with other controls discussed throughout this chapter to achieve cool effects like cartoon stretchiness, muscle bulges, and morphing objects from one shape to another.

Adding Hooks

Shape keys work well for getting specific predefined deformations, but they can be pretty limiting if you want to have a little bit looser control over your mesh or if you're animating things that move in arcs. For these sorts of situations, you have another control mechanism: hooks. Hooks are a special kind of modifier that takes a set of vertices or control points and binds them to be controlled by another object, usually an Empty.

Creating new hooks

The workflow for adding a hook is pretty straightforward. You tab into Edit mode and select at least one vertex or control point. Then you press Ctrl+H ⇒ Hook to New Object. An Empty is created at a location that's the median point of all your selected vertices or control points. You also get a new modifier added to in Modifier Properties, as shown in Figure 11-5.

image

Figure 11-5: Control options for the Hook modifier.

Tab back into Object mode and transform the hook. All the vertices or control points that you assigned to the hook move with it. And using the options in the Hook modifier, you can control how much influence the hook has over these vertices or control points. The following example gives you a clearer understanding of adding and modifying the influence of hooks:

1. Start with the default scene in Blender (Ctrl+N).

2. Select the cube and tab into Edit mode.

All the cube's vertices are selected by default. If not, press A until the vertices are selected.

3. Do a multi-subdivide with four cuts (W ⇒ Subdivide, F6 ⇒ Number of Cuts: 4).

4. Select one of the cube's corner vertices (right-click).

5. Press Ctrl+Numpad Plus (+) a few times to increase the vertex selection.

6. Add a new hook (Ctrl+H ⇒ Hook to New Empty).

7. Tab back into Object mode.

At this point, behavior is as expected. If you select and move the Empty, all the vertices that hooked to it move as if they’re parented to it.

8. With the cube selected, increase the Falloff value in the Hook modifier to 1.00 (Modifier Properties ⇒ Hook-Empty ⇒ Falloff: 1.00).

Now when you select and transform the Empty, the way the vertices follow it is much smoother, kind of like when you're modeling with proportional editing (O). For additional kicks, do the next step.

9. Add a Subdivision Surface modifier to the cube and have it drawn smooth (Ctrl+1, Tool Shelf ⇒ Shading ⇒ Smooth).

Now the transition is even smoother, as shown in Figure 11-6.

image

Figure 11-6: A cube smoothly deformed by a hook.

remember Vertices aren't just bound to their hook's location. They're also controlled by the hook's scale and rotation. You can really get some wild and complex deformations using this deceptively simple feature.

Knowing where hooks are helpful

The best use for hooks is for large organic deformations. Like shape keys, hooks are nice for creating muscle bulges and cartoony stretching. You can even use them along with shape keys. Because shape keys always use the same shape as the basis for deformation, adding a hook can bring a bit more variety. For example, in the bug-eyed Suzanne example from the “Creating Shape Keys” section, you can add a hook for one of the eyes to make it bulge asymmetrically. These touches give more character to your 3D characters.

tip Another great use for hooks is in animating curves in the 3D View. All the steps in the previous examples of this section work for curves and surfaces as well as meshes. If you have a curve that you're using as a character's tail, you can add a hook at each control point. Then you can animate that tail moving around.

Using Armatures: Skeletons in the Mesh

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 an object that provides a similar structure for CG characters. 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+A ⇒ Armature ⇒ Single 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.

image

Figure 11-7: An armature object with a single bone. Woohoo!

Editing armatures

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, as well as the bone itself. (Selecting the bone body actually selects both the head and tail spheres as well.) You can add a new bone to your armature in five ways:

· Extrude: Select either the head or tail of the bone and press E to extrude a new bone from that point. This method is the most common way to add new bones to an armature. If you add a bone by extruding from the tail, you get the additional benefit of having an instant parent-child relationship. The new bone is the child of the one you extruded it from. These bones are linked together, tail to head, and referred to as a bone chain. The Ctrl+left-click extrude shortcut for meshes and curves also works for bones.

· Duplicate: Select the body of the bone you want and press Shift+D to duplicate it and create a new bone with the same dimensions, parent relationships, and constraints.

· Subdivide: Select the body of the bone you want and press W ⇒ Subdivide. You see two bones in the space that the one you selected used to occupy. The cool thing about this option is that it keeps the new bone in the correct parent-child relationship of the bone chain. Also, you can use the Last Operations panel (F6) and do multiple subdivisions.

· Adding: Press Shift+A while still in Edit mode. A new bone is created with its head at the location of the 3D cursor.

· Skeleton sketching: This somewhat advanced feature is incredibly useful for some of the more complex rigging tasks. If you want to try out skeleton sketching, pop open the 3D View's Properties region (N), enable the Skeleton Sketching check box, and expand its panel at the bottom of the region. The fastest way to see what skeleton sketching does is to enable the Quick Sketching check box. Now, when you left-click and drag your mouse cursor in the 3D View, a red line appears in the view. By simply clicking in the screen, you can draw single straight lines. After you're done drawing, right-click, and Blender generates bones along the line you drew.

remember 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). From there, you 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. Double-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.

image

Figure 11-8: Three different ways to name your bones.

tip 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+S ⇒ Cursor to Center, Shift+A ⇒ Armature ⇒ Single Bone) and follow these steps:

1. Tab into Edit mode on your armature and change to front view (Numpad 1).

2. Rename the single bone to root.

It's common convention in rigging to use this name for the main parent bone in the rig.

3. Select the tail of your root bone and extrude a bone to the right (E).

4. Name this newly extruded bone Bone.R.

5. Select the tail of your root bone again and extrude another new bone, but this time to the left (E).

6. Name this bone Bone.L.

7. In the Options tab of the Tool Shelf (T), enable the X-Axis Mirror check box.

8. Select the tail of Bone.R and grab it to move it around (G).

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.

tip 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.

Parenting bones

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+A ⇒ Armature ⇒ Single Bone), and then tab into Edit mode. Then follow these steps:

1. Select the single bone created, duplicate it, and place it somewhere in space (right-click, Shift+D).

2. Add the original bone to your selection (Shift+right-click).

3. Press Ctrl+P to make the original bone the parent of the duplicate.

You’re given two options:

· Connected: This option moves the entire child bone so its head is in the same location as the tail of the parent, creating a bone chain as if you'd created the second bone by extruding it up from the first.

· Keep Offset: Choosing this option leaves the child bone in place and draws a dashed relationship line between the two bones. They're not connected, but one still has an influence on the other, kind of like regular parenting between objects.

4. After you create the parent relationship, select the child bone.

5. Clear the parent relationship by pressing Alt+P.

You have another pair of options:

· Clear Parent: This option removes any sort of parent-child relationship this bone has. If the bone was connected to the parent bone, it’s now disconnected, and you can move it around freely. Note that this does not reposition the child bone back to where you first placed it

· Disconnect Bone: This option doesn't actually clear the parent relationship. Instead, if your bones are connected, choosing this option maintains the parent-child relationship, but the child bone can move independently of the parent’s tip. The bone behaves as if you made the parent by using the Keep Offset option.

Figure 11-9 shows how two bones in an armature can be related.

image

Figure 11-9: Bones that are unparented, with an offset parent, and parented with a connection.

tip 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 either pressing Ctrl+Tab or choosing Pose Mode from the Mode menu in the 3D View's header. (If you have the Pie Menus add-on enabled, Pose mode is an option from the pie that appears when you press 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.

Armature properties

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 in addition to Armature Properties, there are two more sets of properties: Bone Properties and Bone Constraints Properties. Figure 11-10 shows the contents of these panels.

image

Figure 11-10: Armature properties.

As you may have guessed, Armature Properties provide options for the armature overall, while Bone Properties provide options for the currently selected bone. Looking first at 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, while in Edit mode. These controls are exactly the same as the transform controls in the 3D View's Properties region (N).

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.

remember If you enable the Connected check box, the selected bone's head snaps to the location of its parent's tail. However, your selected bone's tail won't move. This is a key difference between setting up a parent-child relationship in Bone Properties and using Ctrl+P in the 3D View.

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. To add your bone to a lot of layers all at once, Shift+left-click and drag your mouse cursor over the bone layers.

remember 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 the mesh's geometry is mapped, or weighted, to the bone, 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 Armature Properties, there are two sets of layer buttons 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.

The Display panel contains a set of buttons for controlling how bones in the armature are displayed:

· Bone display types: You can enable only one of these four buttons at any point in time. Note, however, that even though the bone display type may not be drawn in the 3D View, its influences are still valid. That is, even if you're displaying Stick bones, they still control the same vertices within the range of the Envelope bones. Figure 11-11 shows examples of each of these bone display types:

· Octahedral: The default bone display type, the octahedral shape is great for building a rig because it shows which way a bone points as well as its roll angle.

· Stick: This display type draws the bones as a thin stick. I like to animate with my bones in this type so that they stay out of my way.

· B-Bone: B-bones are drawn as boxes. The interesting thing, though, is that b-bones can be dynamically subdivided and treated as simple Bézier curves. To increase a bone's subdivisions, select the bone and switch to the Deform panel in Bone Properties. In this panel, increase the Segments value, which makes the deformation from one bone to the next much smoother. Even if you don't display the b-bone type, Blender still pays attention to the Segments value. So if your character deforms in an unexpected way, you may want to check the Segments value in Bone Properties.

· Envelope: This display type draws the bones with a scalable sphere at each end and a tube for the bone body. Vertices on your mesh that are within the influence area of these bones will have their locations influenced by them. Use Alt+S to adjust the size of selected spheres and tubes in this display type. Ctrl+Alt+S increases the bone's range.

· newversion Wire: The wire display type is very similar to stick, but it's thinner and even less obtrusive with a thickness of only one pixel. As an additional bonus, this display type also shoes b-bone bending, so it's especially useful and a “working” display type that animators can use.

· Extra display options: You can enable all, one, or none of these options in any combination you desire.

· Names: This check box controls the display of each bone's name in the 3D View. Names can make selecting bones and defining constraints much easier.

· Axes: This option toggles the display of the center axis of the bones. The Axes check box is helpful for understanding the bones’ true roll angle.

· Shapes: To help communicate a bone's purpose to the animator, you can display any bone in Blender as any object in your scene. While in Pose mode, select a bone and go to the Display panel in Bone Properties. There, you can define the object you want as your bone shape by choosing it from the Custom Shape field. With the Shapes check box enabled in Armature Properties, the bone is displayed as your chosen object while in Pose mode.

· Colors: To help organize bones in an armature for an animator, you can actually define custom colors for bones by using bone groups (see the website, www.blenderbasics.com). Set all facial controls to blue, or the left side of the armature in red. Enable this check box so that you can make use of those colors.

· X-Ray: The X-Ray check box in this panel does the same thing that the X-Ray check box in Object Properties does. It allows you to see the bone in the 3D View, even if it's technically inside or behind another object. Enabling this feature makes your bones easier to see and select when rigging or animating.

· Delay Refresh: Rigs by themselves can be very complex. After they have a mesh assigned to them, the system becomes even more complex — sometimes to the point that slower computers can't keep up and perform with any reasonable response. In this type of scenario, enabling this check box may be beneficial because it prevents Blender from trying to calculate how your mesh deforms while you modify a pose on your rig, delaying that calculation until after you finish grabbing, scaling, or rotating a bone.

image

Figure 11-11: The different display types for bones in Blender from top to bottom: octahedral, stick, b-bone, envelope, and wire.

Putting skin on your skeleton

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.

Quick-and-dirty skinning with envelopes

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:

1. In Object mode or Pose mode, select the mesh (right-click) and then add the armature to your selection (Shift+right-click).

2. Make the armature the parent of the mesh (Ctrl+P).

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, you may notice that the mesh still doesn't appear to be influenced by your armature. You need to make a small change in the Armature modifier. Select your mesh again and proceed to the next step.

3. With your mesh selected, enable the Bone Envelopes check box in the Armature modifier (Modifier Properties ⇒ Armature Modifier ⇒ Bone Envelopes).

You can also disable the Vertex Groups check box, if you'd like.

4. Select your armature and go to Armature Properties to enable the Envelope bone type.

This step reveals exactly where the influence of your envelopes lies.

5. If some part of your mesh isn’t under the influence of an envelope, tab into Edit mode and edit its size (Alt+S) and influence (Ctrl+Alt+S).

(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.

image

Figure 11-12: Using envelopes to control your armature's influence over the mesh.

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.

tip 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.

Assigning weights to vertices

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.

A side effect of being able to be a member of multiple groups is another distinction: You can give a vertex a weight, or a numerical value that indicates how much that particular vertex is influenced or dedicated to a specific 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 Mesh 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.

tip 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.

remember 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+P ⇒ Armature Deform. However, the other options give you a lot of power when you use vertex groups:

· Object: This option is just a simple parenting operation. Your whole mesh becomes a child of the armature object, just as if you'd parented it to another mesh or an Empty. No modifier is applied to your mesh at all.

· Armature Deform: As in the envelope skinning example of the preceding section, this option doesn’t create any vertex groups, thereby ensuring that the mesh is only influenced by the bone envelopes.

· With Empty Groups: This option creates vertex groups for you using the names of all the bones with the Deform check box enabled in Bone Properties. However, it doesn't automatically assign any vertices to any of those groups. Use this option if you want to manually assign weights. Without assigning any weights, the default behavior is to be controlled only by bone envelopes.

· With Envelope Weights: This option is a bit of a compromise. It first creates the vertex groups based on the bones with their Deform option turned on. Then it looks at the influence area of the bone envelope and uses that to assign vertices to each vertex group, with their weights varied accordingly. The advantage of this option is that it gets you weighted vertices. The downside, though, is that if the influence area of your envelopes isn't set up well, the weight assignment can look messy.

· With Automatic Weights: This is my favorite option to use. It works like the With Envelope Weights option, but instead of using the influence area of the bone envelopes to determine weights, it uses a more complex process that generally results in better vertex assignments and weights.

· Bone: This is a simple parenting operation like the Object option. No Armature modifier is applied to your mesh. The only difference here is that rather than parent your mesh to the whole armature object, this option allows you to parent your object to a single bone.

· Bone Relative: This option works like the Bone option, but it doesn't move the child object if the bone is moved in edit mode. This option is handy for specific uses, but it isn't frequently used.

Tweaking vertex weights in Weight Paint mode

Regardless of which option you choose for generating your vertex weights, you'll probably still have to go in and manually tweak the weights of the vertices in each vertex group (unless the object you're trying to rig is incredibly simple). 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 from Object 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. If you have the Pie Menus add-on enabled, Weight Paint mode is a pie menu option when you press Tab. 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.

tip 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.

image

Figure 11-13: The painting panels in the Tool Shelf when Weight Paint mode is activated.

tip 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 Draw All Edges check box in the same Display panel of Object Properties.

A handy feature in the Tool Shelf while weight painting is the X-Mirror check box in the Options panel (it's located in the Options tab). 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 Mesh Properties.

Of course, the kind Blender developers have provided a faster way: you can select (right-click) the bone that you want to paint weights for, even while in Weight Paint mode on your mesh. When you right-click a bone, 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.

remember To select bones while in Weight Paint mode, be sure that your armature is in Pose mode before selecting your mesh object.

Because weight paint relies so much on color, I highly recommend you look on the Web (perhaps on this book's website) for full-color version meshes in Weight Paint mode.

remember If you choose to use vertex groups, have a look at the Armature modifier on your mesh. Under the Bind To label are two check boxes: Vertex Groups and Bone Envelopes. By default, only the Vertex Groups check box is enabled. However, both options can be enabled. With both enabled, the mesh is influenced by vertex groups as well as the bone envelopes from your armature. This double influence can be useful in some instances, but most riggers tend to prefer to work with just one or the other. This way, you know that the only reason a vertex is deforming improperly is because its weight isn't assigned properly. You don't have to concern myself with the influence of the bone's envelope.