From BlenderWiki

Jump to: navigation, search

[edit] Rigging basics

Think about how you would animate a character. You definitely wouldn't want to move each vertex, frame by frame. Instead, we'll create a skeleton, complete with bones, and then move the bones in order to move the character. This process is called rigging.

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, by design, is a very simple armature to demonstrate the basics. 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] Apply the Mirror modifier

Up until now, we've been operating on one side of the mesh, and the other side has been automatically updated by the Mirror modifier. The Mirror modifier created virtual vertices on the other side of the mesh, and before we can attach an armature to the mesh we need to make those vertices real.

Important: Make sure the character mesh is the way you want it. We're about to leave the Mirror modifier behind for good. You can always change your mesh later, but it won't be as easy as using the Mirror modifier.

Applying the Mirror modifier to make the mirrored vertices real.
  • 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)


"Modifer is not first" warning.
  • You may get an error message like "Modifier is not first" ("Modifer is not first"). This 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.


Second warning message when applying Mirror modifier.
  • 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. In order to take advantage of symmetrical modeling tools, we want the center of the armature to be on the centerline of the character mesh. To do this,

3D Cursor on centerline of mesh.
  • 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 cursor to the selected vertex
  • The cursor is now on the center line (3D Cursor on centerline of mesh).


3D Cursor on centerline of mesh.
  • Switch to Object Mode and Front View (NumPad 1).
  • Add an Armature object with SPACE>>Add>>Armature.


IMPORTANT: For many of the armature tools to work, the armature object has to have a rotation of (0,0,0) in X, Y, and Z. Depending on what view you added the armature in, your armature may be in a different rotation or location. To reset the armature object back to its default orientation,

  • Switch back to the armature's Object mode.
  • Use Alt R to clear the rotation of the armature object.
  • Now switch back to the armature's Edit mode. Any further rotating or moving should be done in Edit mode.


We've just added an armature, and it's composed of a single bone. Just like with meshes, Armatures have Object and Edit modes, and when you add an armature you automatically enter Edit mode. You can tell you're in Edit mode when you see yellow (selected) or pink (unselected) endpoints of bones.

Anatomy of a Bone.
  • Each Bone has a ROOT (the blunt end) and a TIP (pointy end) (Anatomy of a Bone). At least, that's how they are represented in the default Octahedron draw type. We'll use other draw types later, where the root and tip aren't so obvious.


There are a couple of settings to make before we start building the rest of the rig. With the Armature still selected, these settings can be found in the Edit Buttons.

Bone display settings.
  • Important: In the Armature panel under the Edit buttons, make sure X-Axis Mirror Edit is selected. This will allow us to symmetrically extrude bones to make the skeleton.
  • Also 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).


[edit] Extruding the spine

  • Select the bone you added. You select an entire bone by clicking on the middle of it. You can also select a bone by selecting its root and then shift-selecting its tip.
Moved bone closer to pelvis.
  • Switch to Side View and move the bone so it's closer to the pelvis and near the center of the body, roughly aligned with the neck.


Lengthening the spine1 bone.
  • Select just the tip.
  • Grab the tip and move it up a bit to enlarge the bone in the Z-axis (G and Z) as in Lengthening the spine1 bone.


Extruding the spine 1.
  • With the tip still selected, do a constrained extrude along the Z axis with E,Z to make the second bone in the chain (Extruding the spine 1).


Extruded spine.
  • Do three more Z-constrained extrudes so you have a total of 5 spine bones (Extruded spine). The rib cage doesn't bend in a human, so this spine is a little more flexible than it would be in a real human.


Neck bone.
Head bone.
  • Extrude a neck and a head bone. Note the head bone extends out the top of the head a little bit. That's so we can easily select the bone even if X-Ray is turned off for the armature.


We should name these bones. The names will appear in other parts of the interface, so it's useful to give them meaningful names now to avoid confusion later.

Armature Bones panel in the Edit Buttons.
  • With a bone selected, you can change the name of the bone in the Edit buttons Armature Bones panel (Armature Bones panel in the Edit buttons). I selected the bottom bone and changed the name to spine1.
Named spine bones.
  • Select each of the other bones in the spine and name them something meaningful. I named them, from the bottom, spine1, spine2, spine3, spine4, spine5, neck, and head. When they are all selected, they all show up in the Edit buttons (Named spine bones).


[edit] Extruding the arms symmetrically

Symmetricaly extrude the shoulder bones with Shift E.
  • Go back to Front View (NumPad 1)
  • Select the tip of spine4.
  • Something new: Shift E to symmetrical extrude and create a shoulder bone, as in Symmetrically extrude the shoulder bones. Symmetrical extrude only works if we have X-Axis Mirror Edit mode on, which we (conveniently enough!) turned on a couple steps back.


Symmetrically extrude the upper arm bones.
  • With the tip of the shoulder still selected, do another Shift E symmetrical extrude to make an upper arm bone (Symmetrically extrude the upper arm bones).


Symmetrically extrude the lower arm bones.
  • Continue symmetrically extruding to make the lower arm . . .


Symmetrically extrude the hand bones.
  • . . .the hand bone . . .


Symmetrically extrude the finger bones (1).
Symmetrically extrude the finger bones (2).
  • . . .and two fingers bones.


We have all the arm bones, now lets position them a little better. It's easiest to do this if we can see roughly where the vertices are in the mesh. Since we're working in the Armature's Edit mode, we can't view vertices in the mesh's Edit mode as well. Instead,

  • TAB to exit the armature's edit mode.
  • Select the character mesh.
Disable Subsurf in the 3D Window.
  • Turn off "Subsurf in interactive view" in the Subsurf modifer. This will allow us to see the true base mesh, and line up the bones accordingly (try Wireframe mode without doing this step to see what I mean).


Adjusting the elbow, from Front View.
  • Switch to Wireframe view with Z.
  • 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 from Front View)


Adjusting the elbow from Top View.
  • Do the same from Top View (Adjusting the elbow from Top View).


Top view of arm bones.
  • While you're in Top View, make sure all the arm bones fall within the mesh (Top view of arm bones).
  • 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.


[edit] Naming the bones

Now for some naming. We have to be careful about naming these bones.


[edit] Bone naming conventions

In order to have some very handy X-Axis mirror tools work, we need to name symmetrical bones something like "bone.L" for the left bone, and "bone.R" for the equivalent 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:

  • All lowercase letters for the bone names, including "l" and "r" for left and right
  • Two-word bones will have an underscore separating the names (upper_arm.l)
  • The LEFT side is the CHARACTER'S left side. In front view, this often means you have to think a second before deciding which is left or right.


  • Change the names of the bones to something that makes sense. Just make sure that the left and right bones are symmetrical. 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, and is helpful to see if you missed naming any 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. It's at a strange angle so that all bone names are clearly visible. The names I used were:

Bone names, upper body
  • shoulder.l
  • upper_arm.l
  • lower_arm.l
  • hand.l
  • finger1.l
  • finger2.l

and

  • shoulder.r
  • upper_arm.r
  • lower_arm.r
  • hand.r
  • finger1.r
  • finger2.r



[edit] Testing the rig and adjusting the arms for Auto-IK

By now, you're familiar with Object mode and Edit mode. We're going to use another mode that's specific to armatures: Pose mode.

  • With the armature selected, press Ctrl TAB. This essentially substitutes Object Mode for Pose Mode. In other words, you can now press TAB and switch between Pose mode and Edit Mode. If you need to get Object mode back, press Ctrl TAB again, and you can then switch between Object and Edit mode with TAB. You know you are in Pose mode when you select a bone and it is outlined in light blue.
upper_arm.l selected in Edit mode.
upper_arm.l selected in Pose mode.
Armature selected in Object mode (individual bones cannot be selected in Object mode).


For armatures, Edit mode is used to construct the armature. Object mode is to move the entire armature as a whole. Pose mode is used for, well, posing. In Pose mode, you can grab, rotate, and scale each bone individually.

upper_arm.l rotated in Front view.
  • Try selecting the upper arm in Pose mode and rotating it in Front view. Notice how all bones "downstream" of it rotate as well.


lower_arm.l rotated.
  • Now select the lower arm and rotate it in Front view. The upper arm stayed in place, but the lower arm and everything "downstream" rotated. This is the essence of parenting.

That is, the upper arm is the parent of the lower arm. The lower arm is in turn the parent of the hand bone. Another way to say that is that the hand is the child of the lower arm. These parent-child relationships were automatically created when we extruded the bones. The extruded bone becomes the child of whatever it was extruded from. That's the reason we started from the lower spine and extruded upward, as well as starting at the shoulder and extruding toward the fingers.

Clearing the rotation of all bones in the armature.
  • Clear the rotation of all bones by using A twice to select all, then Alt R to clear rotation. The bones are now reset to their original rotations. You'll end up using this command a lot, along with the related command Alt G, which clears location.


Turn on Auto IK in the Armature panel.
  • Turn on Auto IK in the Armature panel, under the Edit buttons.


finger2.l moved with Auto IK.
  • Select the tip of the arm and move it with G. Note that it moves much differently now!


A little explanation: Forward Kinematics, or FK, is the way of moving bones that we first used. That is, rotate the upper arm, and its children (and children's children!) follow along. The opposite of FK is Inverse Kinematics (IK), where we move a child and the parents follow along. In reality, there is some fancy math going on in the background that tries to point the chain of bones toward the target. What's the target? For Auto-IK, it's whatever bone you have selected. In this case, the target is the finger2.l bone. What's the chain? It's the lineage of bones going all the way back to the great-great-great-(etc)-grandparent.

In our armature, when we moved the finger bone, all the bones in the chain tried to point to wherever we moved it. An orange line showed up, connecting the finger2.l bone to the spine1 bone. The orange line points to the root of the chain: spine1 is the highest parent of finger2.l, and the chain is everything between spine1 and finger2.l.

It would be nice if the spine didn't move so much when we moved the arm. We'll fix this by essentially breaking the IK chain at the shoulder so only the arm moves and the spine stays still.

Select upper_arm.l in Edit mode.
  • Go into Edit mode of the armature with TAB. Note that even though you may have just moved some bones around in Pose mode, upon entering Edit Mode everything goes back to the way it was. In Edit Mode, you're viewing the bones as they are in Rest position, and once you go back out to Pose mode, your posed armature will return.
  • Select the upper_arm.l bone in Edit mode.


Deselect the "Con" button to disconnect upper_arm.l from shoulder.l.
  • In the Armature Bones panel under the Edit buttons, deselect the Con button. In this panel, the child of: menu indicates that this bone, upper_arm.l, is the child of shoulder.l. We want to keep that relationship, but we'd like to allow upper_arm.l to be disconnected from shoulder.l . . . and therefore break the IK chain. Con stands for Connected. By deselecting this button, we disconnected the upper_arm.l bone from the shoulder.l bone.


Moving the finger2.l bone after breaking the IK chain at upper_arm.l.
  • To test this new setting, switch to Pose mode (TAB).
  • Reset the armature by pressing A twice to select all bones, Alt G to clear locations, and Alt R to clear rotations.
  • Now, move the finger2.l bone again. Much different! The orange line now points to the root of the chain, which is the upper_arm.l bone.


While we were able to extrude bones symmetrically, we have to make changes to the settings separately. To disconnect the upper_arm.r bone from shoulder.r in the same way,:

  • Switch to the armature's Edit mode
  • Select upper_arm.r.
  • Deselect the Con button.
  • Test the armature.


[edit] Add an Armature modifier to the Mesh

Checking the name of the armature (select it and check the name that shows up here).
Enter the name of the armature object into the armature modifier, and make sure only Vertex Groups is selected (Envelopes should be unselected.

Now that we have an armature, it's time to attach it to the mesh. To do this, we'll add an Armature Modifier to the mesh.

  • Select the character mesh, in Object Mode
  • In the Edit Buttons, choose Add Modifier>>Armature
  • Important: move the Armature Modifier to the top of the modifier stack with the up arrow. If you don't, then your mesh might deform in weird ways later on.
  • 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 in the Edit buttons, 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 in this tutorial.

Now Blender knows that we want the armature to affect the character mesh. Next, we need to tell Blender exactly what vertices to move when we move, say, upper_arm.l.

Summary
We added an armature object, and sequentially extruded bones to make an armature for the upper body. We made some changes to allow for the use of Auto-IK, should we choose to use it later on. Next up: weight painting!


Next: Upper body: weight painting

Previous: Materials and textures

Back to Index