From BlenderWiki
[edit] Rigging basics
Rigging is setting up a skeleton that moves the mesh. It would be mind-bogglingly tedious to move every single vertex if you wanted to make a character move. Instead, we create a skeleton, complete with bones, and then move the bones in order to move the character.
In Blender, the skeleton is called an Armature. The idea is this:
- An Armature is composed of many Bones.
- Each Bone can have some vertices assigned to it.
- When you move a Bone, just the vertices assigned to it will move, and all the other vertices will stay still.
- The goal is to set up the Bones in the Armature so that neighboring Bones move neighboring vertices smoothly and naturally.
Just to give you a heads up, first we'll create the upper body armature, and once that's done we'll move to the lower body. Legs and feet take a little more work to do right, but hopefully by the time you get there you will be experienced from working on the upper body!
[edit] For "real" armatures . . .
This is, by design, a very simple armature. If you are interested in making your character easier to control, see the Rigging BSoD project. There you will find lots of information on rigs suitable for the most demanding applications. Here, we're just doing a simple rig to illustrate Blender's tools.
[edit] Create the armature for the upper body
[edit] Apply the Mirror modifier
The first thing to do before adding an armature is to Apply the Mirror modifier that we've been using for modeling the mesh. Up until now, we've been operating on one side, and the other side has been a "virtual" mirror. Now, we'll make those virtual vertices real.
<span id="01"/>
<span id="02"/>
<span id="03"/>
- With the character mesh selected, go to the Edit buttons
- In the Mirror modifier, click Apply (Applying the Mirror modifier to make the mirrored vertices real)
- You may get an error message like "Modifier is not first" ("Modifer is not first". This just refers to the stacking order of the modifiers; just click on the message and the Mirror modifier will automatically be moved to the top of the stack for you.
- The next message you see is "Applying will delete mesh sticky, keys, and vertex groups" (Second warning message). Click on that message to accept. We haven't made any such groups yet, so it'll be OK. We're about to make a LOT of vertex groups, though -- this is why we're applying the Mirror modifier now instead of later!!!
[edit] Add Armature
Time to add the Armature. We want to add it on the centerline of the mesh, so it will be symmetrical. To do this,
- Select the mesh and enter Edit Mode.
- Select a vertex on the center line of the mesh.
- Shift S for the snap menu
- Cursor to Selection to snap the curso to the selected vertex
- The cursor is now on the center line.
<span id="05"/>
Now add a new armature:
- Get back to Object Mode
- SPACE>>Add>>Armature
We've just added an armature, and it's composed of a single bone (The new armature). There are a couple of settings to make before we start building the rest of the rig. These settings can be found in the Edit Buttons.
- Make sure X-Axis Mirror Edit is selected. This is a great new feature (2.40+) that will make our job MUCH easier.
- Make sure X-Ray is selected. This makes the bones visible through the mesh, and makes editing easier - we don't have to keep switching to wireframe view to see the bones inside the body (Bone display settings).
<span id="04"/>
Armature and bone terminology
Bones have a ROOT (the blunt end) and a TIP (pointy end). Bones can have parents and children. As an example, check out Bone relationships, below.
|
[edit] Extruding the spine
Selecting bones
|
- Select the bone you added.
- G and MMB
to move the bone only in the Z axis, so it's down by the pelvis.
- Select just the tip
- Grab the tip and move it up a bit to enlarge the bone in the Z-axis (use G and MMB
again) as in Extruding the spine 1.
- With the tip still selected, do a constrained extrude along the Z axis with E, MMB
to make the second bone in the chain (Extruding the spine 2).
- Do another Z-constrained extrude so you have 3 spine bones (Extruding the spine 3)
- Switch to side view (NumPad 3). Note that the bones are outside the body (Spine, side view) - we've got to move them back inside.
- Select all the bones (A and do a Y-constrained move backwards (G, MMB
), as in (Move spine back along Y-axis)
- Select the root/tips one by one and move them to adjust the spine, something like Move root/tips to adjust.
Let's name these new bones. Default names like Bone.001 don't help much.
- In the Edit Buttons you can change the name of the bones (Changing the bone names).
- I named them, from the bottom, spine1,spine2, and spine3. When they are all selected, they all show up in the Edit buttons (Named spine bones).
- Note the Parent box, where you can select the parent of the selected bone, and the Co button, where you can select whether the bone is connected to its parent.
[edit] Extruding the arms symmetrically
- Go back to Front View (NumPad 1)
- Select the tip of spine3.
- Something new: Shift E to symmetrical extrude and create a scapula (shoulder blade), as in Symmetrically extrude the scapula bones.
- Symmetrical extrude only works if you have X-Axis Mirror Edit mode on, which we (conveniently enough!) turned on a couple steps back
- With the tip of the scapula still selected, do another Shift E symmetrical extrude to make upper arm (humerus) bone (Symmetrically extrude the humerus bones).
- For the next extrude, make an "elbow" bone (Symmetrically extrude the "elbow" bones).
- Real humans don't have elbow bones of course, but this extra little bone will make bending the arm look better later on.
- Continue symmetrically extruding to make the lower arm ("ulrad", named after the ulna and radius bones), the hand bone, and the fingers bone.
- TAB to exit the armature's edit mode.
- Select the character mesh.
- Turn off "Subsurf in interactive view" in the Subsurf modifer and use Z for wireframe view.
- Select the armature again, and enter Edit Mode (TAB.
- Adjust the elbow so that it falls within the three elbow vertices in the mesh (Adjusting the elbow)
- TAB, select character mesh, turn Subsurf back on in interactive view, hit Z again for shaded mode
- Select the armature again and enter Edit Mode.
- Adjust the arm bones in Top View (NumPad 7 so that they're inside the mesh. In this case, they looked OK (Arm bones in top view).
[edit] Naming the bones
Now for some naming. We have to be careful about naming these bones.
Bone naming conventions
In order to have some of the X-Axis mirror tools to work, we need to name symmetrical bones something like "bone.L" for the left bone, and "bone.R" for the right bone. You could also use "bone.l" and "bone.r", or "Left.Bone" and "Right.Bone" . . . the symmetrical tools are pretty smart that way ONLY as long as both symmetrical bones have the same naming convention. To be consistent, I'm going to use:
Examples: hand.l IK_arm.r femur.r |
Under the Edit buttons (same place you turned on X-Ray and X-Axis Mirror Edit), you can turn on Draw Names. This will display the names of the bones.
Bone names, below, is a screenshot of the names of the bones I used. You'll probably have to click on the image to view it full size and see the bone names.
If you didn't follow these instructions exactly, it's possible that you don't have the same parent-child relationships. For reference, I have the following setup. spine1 is parent of spine2, elbow.l and elbow.r are children of humerus.l and humerus.r, respectively. It's worth it to double check that this is the case in the Edit buttons,
- spine1
- spine2
- spine3
- scapula.l, scapula.r
- humerus.l, humerus.r
- elbow.l, elbow.r
- ulrad.l, ulrad.r
- hand.l, hand.r
- fingers.l, fingers.r
- hand.l, hand.r
- ulrad.l, ulrad.r
- elbow.l, elbow.r
- humerus.l, humerus.r
- scapula.l, scapula.r
- spine3
- spine2
[edit] Create a Null Bone for IK Solver
OK, we're finally stepping into genuinely new territory (compared to the Gus the Gingerbread Man tutorial).
When you animate, you can move bones one of two ways: FK or IK. FK stands for "forward kinematics" and IK stands for "inverse kinematics". Not like that means anything to you.
Basically, in FK mode, you have to move and rotate bones individually. This gives you the most control, but can be quite slow.
In IK mode, you grab a single bone (the target) and move just that bone around. The rest of the bones in the chain will try to follow that bone. This can give you quite natural animation in a very short time. The best way to explain it is by pointing you to the animation at the top of this page: Noob to Pro page on IK
Our goal is to make a target for the arms so that the arms will follow the target wherever we move it. Onward!
- In Edit Mode for the armature, extrude the tip of the fingers.l bone. As long as you still have X-Axis Mirror Edit still activated, the fingers.r bone will be extruded as well.
- I extruded the bone straight up and made it pretty big, so during animation it'll be obvious which bone to grab to move the arm.
- Name the bones IK_arm.l and IK_arm.r, as appropriate (Extruded IK target)
- Make both IK targets be child of NONE in the Edit Buttons, by choosing the empty spot on the "Child of:" drop-down box (Make both targets be children of none)
- Note: an IK target CANNOT be part of the chain it is a target for . . . otherwise, strange and frustrating things may happen! In other words, a target cannot have a parent in the chain. Here, we solved the problem by giving the target bones no parents at all to worry about.
[edit] Add an IK Solver
New concept: Pose Mode
You've already used Object Mode and Edit Mode in meshes, and in the armature. Now we're going to use another mode of armatures: Pose Mode (Ctrl TAB. Pose Mode exactly what it sounds like: it's where you pose the bones, frame by frame, to generate an animation. You know you're in Pose Mode when selected bones are outlined in blue. Pose Mode is the ONLY place you can:
Edit Mode, in contrast, is the only place where you can:
In BOTH modes you can:
|
I'll show you how to add an IK solver in two ways. First, the "long" way:
- Enter Pose Mode (Ctrl TAB
- Select the fingers.l bone
- In the Edit Buttons, click on Add Constraint>>IK Solver (Add an IK solver).
- An IK constraint will appear in the Constraints tab.
- We've just added an IK solver to the fingers.l bone, but still need to tell it where the target is. The red "Const" box serves as a warning that the constraint is not yet fully configured.
- In the OB: (object) text box, enter the name of your armature object (default is simply Armature)
- In the BO: (bone) text box, enter the name of the target. In this case, it's IK_arm.l. The red "Const" box turns back to gray (Enter the armature's name and the target bone).
Note that in the 3D window, the fingers.l bone turned yellow (IK solver turns yellow). This indicates that it has an IK solver on it. Also note the yellow dotted line extending to the pelvis. By default, an IK solver tries to point all the bones in the chain from its first root (it's great-great-great etc. parent, in this case the spine1 bone) towards the target.
Try moving the target bone around to see what happens (Moving the target bone with default ChainLen). The spine moves, as well as the other arm! That would get pretty annoying when trying to animate. To fix this, we'll shorten the length of the IK chain so it only includes the bones in the left arm -- not the entire spine, down to the root bone of spine1.
- Select the fingers.l bone (the yellow one with the IK solver)
- In the Edit Buttons, look for the ChainLen number box. It should say zero, by default. Zero means the IK solver will look all the way down the chain (so I guess it's more like infinity than zero).
- Click the right arrow in the ChainLen number box until it says 5 (Adjusting the ChainLen). This is the number of bones, INCLUDING the IK solver, that are in the chain. In other words, this will make the IK chain only 5 bones long - fingers.l, hand.l, ulrad.l, elbow.l, and humerus.l.
- Note: The dotted yellow line might seem to disappear, but it's just pointing to the bones in the arm, which might hide the yellow line.
- Select the target bone, and move it around to try it out. Much better!
[edit] Adding another IK solver to the right side
Here's an easier way to add an IK constraint:
- First select IK_arm.r
- Shift-select fingers.r (Shift RMB
, Shift-select target, THEN solver)
- Ctrl I to create an IK solver.
- Select the only option, Add IK Constraint: To Active Bone
- Adjust the ChainLen to 5, as above.
- Looks good! (Moving the targets with adjusted ChainLen)
[edit] Head and neck bones
This part is fairly straightforward:
- Select the armature
- TAB to enter Edit Mode
- Extude the spine3 bone constrained in the Z-axis to make the neck bone (and name it neck)
- Extrude the neck to create the head bone (and name it, you guessed it, head)
Now we'll add another IK bone so that we can easily move the torso around.
- Select the armature.
- Get to Edit Mode Ctrl TAB, where the highlighted bones are yellow.
- Select the tip of the bone spine3 (the node to which the neck, scapulae, and spine3 are all connected, Select the tip of spine3).
- Switch to side view, and extrude a new bone backward.
- Select the new bone and name it IK_torso (The IK_torso target).
- In the edit buttons, make IK_torso have no parent, by selecting the blank menu item in the Parent Of: combo box. This is the same thing we did above for the IK_arm.l and IK_arm.r bones.
- Switch to Pose Mode, where we can add constraints.
- First select IK_torso. Then shift-select spine3.
- Ctrl I to make an IK constraint.
- spine3 should turn yellow, indicating it has an IK constraint on it.
- Try moving IK_torso around - the entire spine and upper arms will follow, but the arms will attempt to stay pointed at IK_arm.l and IK_arm.r respectively (Testing the movement of the armature).
We're done rigging the upper body!
[edit] Apply the Armature modifier to the Mesh
Now that we have an armature, it's time to tell the mesh we want it to move when we move the bones. To do this, we'll add an Armature Modifier.
- Select the character mesh, in Object Mode
- In the Edit Buttons, choose Add Modifier>>Armature
- In the Ob: text box, enter the name of the armature object (Enter the name of the armature object into the armature modifier).
- The default armature name is, logically enough, "Armature". To double check the name of your armature, select the armature and look for the OB: text box, like in Checking the name of the armature.
- In the Armature Modifier, make sure only Vertex Groups buttons are selected. We will not be using Envelopes.
Envelopes vs Vertex Groups
The two buttons in the Armature Modifier, Envelopes and Vertex Groups, represent the two different ways you can use bones to move a mesh. Envelope mode causes a bone to affect the mesh only where the mesh's vertices are inside the bone's envelope. It's quick and easy. The downside is, it's difficult to fine-tune the envelope. That's where Vertex Groups come in. Vertex Group mode allows us to manually specify which vertices are moved by which bone. This allows far more control over the rig -- basically, on a vertex-by-vertex basis. It's possible to combine the two, but things get a little tricky. To keep this tutorial straightforward, we will not use Envelopes. |
[edit] Painting vertex groups
By adding that Armature Modifier to the mesh, we are telling the mesh to look for the armature. However, we still haven't told Blender which vertices we want to move with which bones. The interactive way to do this is with weight painting.
We're going to use another mode of meshes you haven't been introduced to yet: Weight Paint Mode. This mode is very powerful. Before we start fixing the armature and mesh, I want to give you a quick tour.
[edit] A quick tour of Weight Paint Mode
Imagine two bones, Bone 1 and Bone 2, with the same vertices assigned to each of them. Now imagine you tell Bone 1 to go one way, and Bone 2 to go the other way. Which bone do the vertices follow?
The answer depends on the weight of the vertices for each bone. By default, vertices assigned to two different bones have a weight of 50% each bone. The weight on the vertices will be 50% Bone 1 and 50% Bone 2. This means that when you move Bone 1 one way and Bone 2 another way, the vertices will try to split the difference. That is, follow Bone 1 50% and Bone 2 50%.
If you wanted those vertices to follow Bone 1 more closely than they follow Bone 2, than you would weight the vertices to be, say, 75% Bone 1 and 25% Bone 2. The easiest way to assign weights to vertices is in Weight Paint Mode.
To get into Weight Paint Mode, the shortcut is Ctrl TAB, analagous to how you got into Pose Mode for an armature. The first thing you notice is that the mesh turns dark blue. The color is important in weight painting! It tells you what weight the vertices have for a given bone.
- Dark Blue = 0
- Light Blue = 25% (or 1/4)
- Green = 50% (or 1/2)
- Yellow = 75% (or 3/4)
- Red = 100% (or 1)
OK, let's check out the tools available for weight painting. With the mesh selected, press Ctrl TAB to get into Weight Paint Mode. A new panel, the Paint panel, is now visible in the Edit Buttons (Paint panel).
- First, select the fingers.l bone. Selecting a bone means you will start assigning vertices to that bone.. We're going to assign the vertices in the hand to the fingers.l bone.
- In the Paint panel, make these settings:
- Choose a weight of 0.5 (either by using the slider, or by clicking the quick-select button labeled 1 under the slider).
- Choose an opacity of 1.
- Leave the size at 25.
- Make sure All Faces is off. This option lets you paint on everything under the brush and can be useful, but it may only confuse things at this point in the game. We'll leave it off for now.
- Make sure Vertex Dist is off. This takes vertex distances into account to make the painting sort of smooth. This tends to be used on more complicated meshes, for now, leave it off.
- Make sure 'Normals is off. This applies vertex normals before painting, we don't need it.
- Make sure Spray is off. This keeps applying paint as long as you keep the mouse pressed. Again, it's handy, but will make things more complicated right now, so leave it off.
- IMPORTANT: Make sure X-Mirror is selected. This will allow us to paint only one side of the mesh, and the matching vertex group on the other side will be automatically painted. Very, very handy.
- Leave Wire unselected. This overlays the wireframe on top of the mesh -- right now, it'll just make the view more complicated than it needs to be.
- X-axis mirroring
- Painting tools
- Colors
- Posing in Vertex Paint mode





















![[]](/skins/blender/open.png)
