Sub topic 1
Armatures, Rest Pose, and Pose Bones
Every IK setup and bone constraint in this tutorial acts on pose bones. If you don't know which data you are editing, rigs behave in confusing ways. This chapter lays out how Blender stores an armature, what the rest pose is, and how pose bones differ from the bones you build in Edit Mode.
Prerequisites
This chapter assumes you can already do the following:
- Navigate the 3D viewport and select objects.
- Create an armature and add bones in Edit Mode.
- Switch between Object, Edit, and Pose Mode.
- Insert basic keyframes.
- Read short Python scripts (only for the scripted examples).
One Armature, Three Views of a Bone
An armature is a skeleton made of bones. Blender stores it in two places, and Python exposes three bone types, one for each context:
- The Armature data-block (
bpy.types.Armature) holds the rest pose. It defines where each bone sits when no animation is applied. - The Armature object (
bpy.types.Object) wraps that data and adds a pose: a set of per-bone transforms layered on top of the rest pose. - Each bone therefore appears in the API as an edit bone, a bone, and a pose bone.
| Type | Python access | Available when | Holds |
|---|---|---|---|
| Edit bone | `armature.edit_bones` | Edit Mode only | Editable rest head, tail, roll, parent, connection |
| Bone | `armature.bones` | Always (read-only geometry outside Edit Mode) | The stored rest pose, such as `head_local` and `tail_local` |
| Pose bone | `object.pose.bones` | Always | Location, rotation, scale, constraints, IK settings |
Constraints and IK settings belong to pose bones, not to the armature data. The pose belongs to the object, so you can have two objects that share one Armature data-block but hold different poses.
Pose bones match bones by name. If you rename a bone in Edit Mode, Blender renames the pose bone too. A name stored in a driver path or a script string, such as pose.bones["forearm"], does not update automatically.
The Rest Pose
The rest pose is the arrangement of bones as built in Edit Mode. It is the reference state, and the pose is always measured relative to it.
A fresh pose bone has an identity transform: location (0, 0, 0), no rotation, scale (1, 1, 1). Identity means "stay at rest." The pose bone's transform is an offset from rest, not an absolute position in the scene.
This has practical consequences:
- Rotating a pose bone by 30° means 30° away from its rest orientation, in the bone's own local frame.
- Resetting a bone to its rest pose clears its transform. In the viewport, Alt+G, Alt+R, and Alt+S clear location, rotation, and scale for the selected pose bones.
- If you edit a bone in Edit Mode after posing, the pose offsets are re-applied to the new rest position. Posed meshes can jump, so finalize the rest pose before you animate.
The armature data has a Pose Position / Rest Position toggle in the Object Data properties. Rest Position shows the skeleton without any pose applied but does not delete the pose. It is a quick way to check whether a problem comes from the rest pose or the posing. In Python the setting is armature.pose_position, with values 'POSE' and 'REST'.
Bone Local Axes
Every bone has its own coordinate frame. The Y axis runs from head to tail along the bone. The X and Z axes are set by the bone's roll, which you edit in Edit Mode. Pose bone rotations are expressed in this local frame, so rotating around "X" means different world directions for different bones.
Two bones with different roll values can have the same head and tail positions but rotate in different directions for the same input. Later chapters rely on this: IK locks, limits, and constraint spaces all use these local axes. When a bone bends the wrong way, check its roll first.
Rotation Modes
Each pose bone stores its rotation in one of several modes. The default for a new pose bone is Quaternion (WXYZ). Euler modes and Axis-Angle are also available. Only the values for the active mode are used.
This catches many scripts. If you set rotation_euler while the bone is in quaternion mode, nothing visibly changes, because the Euler values are stored but ignored. Set rotation_mode first.
Inspecting Rest and Pose from Python
The script below builds a single bone, rotates its pose bone, and prints rest and posed positions side by side. Run it from the Text Editor in a new scene.
import math
import bpy
arm_data = bpy.data.armatures.new("DemoArmature")
rig = bpy.data.objects.new("DemoRig", arm_data)
bpy.context.collection.objects.link(rig)
bpy.context.view_layer.objects.active = rig
rig.select_set(True)
# Edit Mode: define the rest pose with edit bones.
bpy.ops.object.mode_set(mode='EDIT')
segment = arm_data.edit_bones.new("segment")
segment.head = (0.0, 0.0, 0.0)
segment.tail = (0.0, 0.0, 1.0)
# Pose Mode: bones now exist as Bone and PoseBone data.
bpy.ops.object.mode_set(mode='POSE')
pose_bone = rig.pose.bones["segment"]
pose_bone.rotation_mode = 'XYZ' # default is QUATERNION, which would ignore rotation_euler
pose_bone.rotation_euler = (math.radians(45.0), 0.0, 0.0)
bpy.context.view_layer.update()
bone = arm_data.bones["segment"]
print("Rest tail (armature space):", tuple(bone.tail_local))
print("Pose tail (armature space):", tuple(pose_bone.tail))
# Show the rest pose without deleting the pose, then restore it.
arm_data.pose_position = 'REST'
bpy.context.view_layer.update()
print("Pose tail in REST mode:", tuple(pose_bone.tail))
arm_data.pose_position = 'POSE'
bpy.ops.object.mode_set(mode='OBJECT')The rest tail stays at (0, 0, 1). The posed tail moves because the bone's transform is applied on top of rest. In the viewport, the Rest Position toggle shows the unposed skeleton, and the printed pose tail returns to the rest value in that mode.
Pose Space and Matrices
A pose bone exposes matrix, its final transform in armature space after the pose, constraints, and IK have been evaluated. It also exposes matrix_basis, the transform made from just its own location, rotation, and scale values. The difference is important later. Constraints change matrix but never alter the values you keyed in location or rotation_*. This is why a constrained bone can look posed while its channels still read zero.
Both matrices only reflect current results after Blender re-evaluates the scene. In scripts, call bpy.context.view_layer.update() after changing the pose and before reading matrix, head, or tail.
Common Mistakes
- Editing rest bones when you meant to pose. Moving a bone in Edit Mode changes the rest pose and changes how every animation is interpreted. Pose Mode is where animation happens.
- Expecting poses to survive on a new armature. Poses belong to the object. Re-creating the armature object resets them.
- Using the wrong rotation property. Check
rotation_modebefore reading or writingrotation_eulerorrotation_quaternion. - Reading stale results from scripts. Update the view layer before you read evaluated matrices.
Exercise
You run pose_bone.rotation_euler = (0.5, 0, 0) in a script, but the bone does not move in the viewport. The bone was just created and you have not touched its rotation settings. What is the most likely cause, and how do you fix it?
Show answer
A new pose bone uses Quaternion rotation mode, so the Euler values are stored but ignored. Set pose_bone.rotation_mode = 'XYZ' (or another Euler order) before assigning rotation_euler, or write to rotation_quaternion instead.
Exercise
A teammate says that constraints on a pose bone change the bone's location values in the Transform panel. Is that correct? Where can you see the constrained result from Python?
Show answer
No. Constraints do not change the channel values you set or keyed. They change the final evaluated result, which you can read from pose_bone.matrix (armature space) after updating the view layer. The values in location, rotation_*, and scale still describe only the bone's own offset from rest.