Sub topic 1
What an armature is
An armature is Blender's skeleton system. It is a set of bones that you pose to deform a mesh or to drive other objects. This chapter covers how an armature is stored, how it differs from the mesh it moves, and which parts of it you will touch in later chapters.
Prerequisites
This chapter assumes you can already do the following:
- Navigate the 3D viewport and select objects.
- Switch between Object Mode and Edit Mode on a mesh.
- Read object transforms: location, rotation and scale.
- Understand parent and child objects.
You do not need any rigging experience. Python examples assume you know basic bpy usage, such as running a script from the Scripting workspace.
Two data-blocks, not one
Blender separates an object from the data it displays. A mesh object, for example, is an object that points to a mesh data-block. An armature follows the same pattern and has two parts:
- The armature object has a position, rotation, scale and parent in the scene. It also holds the pose, which is the current state of every bone.
- The armature data holds the rest pose: the bones' lengths, positions and parent links as you designed them.
This split explains most rigging behavior. When you move a bone in Pose Mode, you change the pose stored on the object. The armature data stays the same. Chapter "Rest pose versus pose" covers this in detail. For now, remember that "where a bone was built" and "where a bone is now" are stored in different places.
| Part | Lives on | Contains |
|---|---|---|
| Armature object | `bpy.data.objects` | Scene transform, pose bones, constraints, modifiers that reference it |
| Armature data | `bpy.data.armatures` | Edit bones (rest pose), hierarchy, bone collections, display settings |
What an armature does
An armature does not draw anything in a render. Bones are a viewport aid. They have no surface, and they never appear in the final image unless you give them geometry some other way. An armature affects the result in two ways:
- Deforming a mesh. A mesh follows bones through an Armature modifier and vertex groups. The mesh reads bone transforms and moves its vertices to match.
- Driving other things. Bones can carry constraints, parent other objects, or act as targets. A bone can move a camera, a light or a prop.
Because the armature is a separate object, one rig can drive several meshes, such as a body, clothes and eyes. Meshes can also be swapped without rebuilding the skeleton.
Creating an armature
In the 3D viewport, choose Add > Armature > Single Bone. Blender creates an armature object with one bone named "Bone". The object is placed at the 3D cursor.
Select the object and note the Outliner. You will see the object, its armature data and its bones listed beneath. Blender gives the object and the data the same default name, but they are different data-blocks. You can rename either one without affecting the other.
You can also build the same thing in Python. This script creates an armature object, links it into the scene, and adds a root bone and a connected child bone:
import bpy
# Create armature data and an object that uses it
arm_data = bpy.data.armatures.new("DemoArmature")
arm_obj = bpy.data.objects.new("DemoRig", arm_data)
bpy.context.collection.objects.link(arm_obj)
bpy.context.view_layer.objects.active = arm_obj
# Edit bones can only be created in Edit Mode
bpy.ops.object.mode_set(mode='EDIT')
root = arm_data.edit_bones.new("root")
root.head = (0, 0, 0)
root.tail = (0, 0, 1)
child = arm_data.edit_bones.new("child")
child.head = (0, 0, 1)
child.tail = (0, 0, 2)
child.parent = root
child.use_connect = True
bpy.ops.object.mode_set(mode='OBJECT')The first three lines after the import show the two-part structure directly. bpy.data.armatures.new makes the data. bpy.data.objects.new makes the object that uses it. Both are needed.
Where the bones are stored
An armature exposes the same bones through three different collections. Which one you use depends on the mode you are in.
| Collection | Access | Available in | Used for |
|---|---|---|---|
| Edit bones | `arm_data.edit_bones` | Edit Mode only | Creating, moving and re-parenting bones |
| Bones | `arm_data.bones` | Any mode, read mostly | Reading the rest pose and hierarchy |
| Pose bones | `arm_obj.pose.bones` | Pose Mode and Object Mode | Posing, constraints, keyframes |
A common error is to read arm_data.edit_bones while the object is in Object Mode. The collection exists but is empty, so lookups fail with a KeyError. Switch to Edit Mode first, or read from arm_data.bones instead.
A second common error is to set a bone's head or tail through arm_data.bones and expect it to change. Those values are read-only outside Edit Mode. Edit the rest pose with edit bones, and change the pose with pose bones.
Armature display settings
The armature data also controls how bones are drawn. In the Object Data properties you can choose a display style such as Octahedral, Stick, B-Bone, Envelope or Wire. Enabling In Front in the Viewport Display panel draws bones over the mesh, so you can see them inside a solid model.
These settings only change what you see in the viewport. They have no effect on how a mesh deforms.
Common mistakes
- Scaling the armature object to resize the rig. Scaling changes how the pose is evaluated and can produce unexpected deformation later. Apply the scale with Ctrl+A > Scale while in Object Mode, or resize bones in Edit Mode.
- Forgetting that a bone needs the armature to be active. Mode switches act on the active object. Make the armature active before you call
mode_set, as the script above does. - Expecting bones to render. If you need a visible skeleton in a render, you need to add geometry.
- Confusing the armature with the mesh. Selecting the mesh and trying to pose it does nothing. Select the armature, then enter Pose Mode.
Where this leads
The next chapters look inside the bone: its head, tail and body. After that you will learn the three modes in detail, then how bones form a hierarchy. Mesh binding comes after the skeleton is solid.
Exercise
You run a script that adds a bone with arm_data.edit_bones.new("spine") while the armature object is in Object Mode. The script raises an error or the bone never appears. What is the cause, and how do you fix it?
Show answer
Edit bones can only be created and accessed while the armature is in Edit Mode. Make the armature the active object, call bpy.ops.object.mode_set(mode='EDIT'), create the bone, and then return to Object Mode with bpy.ops.object.mode_set(mode='OBJECT').
Exercise
A teammate says "I moved the bone in Pose Mode, but its head position in the armature data did not change." Is the data wrong? Explain where each value is stored.
Show answer
The data is correct. The rest pose (head, tail, parent) is stored in the armature data. Pose Mode changes only the pose bones on the armature object. This is why you can return a rig to its rest position without losing the original design.