Sub topic 13
Keyframing poses
A pose is a single arrangement of bone transforms. An animation is a set of poses stored at different frames, with Blender filling in the frames between them. This chapter assumes you can switch between Object, Edit and Pose modes, and that you know the difference between rest pose and pose. It also assumes you can rotate bones in Pose Mode (forward kinematics, FK).
What a keyframe on a bone stores
When you keyframe a pose bone, Blender records the value of one or more properties on that bone at the current frame. The properties are location, rotation, scale, and any custom property you choose. The keyframes are stored in an action, which is a container of F-curves. Each F-curve records one channel, such as pose.bones["child"].rotation_euler[0].
Three points affect how you work:
- Keyframes belong to the armature object, not to the armature data. The rest pose is not animated, and edit bones cannot be keyframed.
- Only the channels you key are animated. If you key rotation only, location stays wherever the pose or its parent puts it.
- Values are stored relative to the rest pose. A rotation of 0 on a pose bone means "stay at rest", not "point along the world X axis".
Keying in the viewport
In Pose Mode, select one or more bones, hover over the 3D viewport and press I. Since Blender 4.1, this keys the channels listed in the Default Key Channels preference. Those are location, rotation, scale and custom properties unless you changed them. Older versions opened a menu where you picked the channels.
To key only specific channels, use the K menu (Keying Set menu). Typical choices are Location, Rotation, Scale, and Location, Rotation & Scale. You can also right-click any single property field in the Properties editor and choose Insert Keyframe.
A bone's rotation mode decides which property gets keyed. New bones use Quaternion (rotation_quaternion, four channels W, X, Y, Z). If you set the mode to XYZ Euler, the animated property is rotation_euler. Keys written to the old mode stay in the action but stop having an effect when you switch modes. This is the usual cause of "my animation stopped working after I changed rotation mode."
Timeline, Dope Sheet and Graph Editor
| Editor | Use it to |
|---|---|
| Timeline | Scrub, play, and see keys for the selected bones |
| Dope Sheet | Move, copy, scale and delete keys in time; group by bone |
| Graph Editor | Edit F-curves, interpolation and handles |
By default, the Dope Sheet and Timeline show only keys for selected bones, and the "Only Show Selected" filter applies in Pose Mode. If your keys seem to be missing, check that filter first.
Interpolation controls how Blender fills the frames between keys. Bézier gives smooth ease-in and ease-out and is the default. Linear gives constant speed. Constant holds the value and then jumps, which is used for stepped blocking. Select keys and press T in the Dope Sheet or Graph Editor to change it.
A typical workflow
Animators usually work pose to pose. They block the key poses first, then refine the timing and the in-betweens.
Key all the bones that matter at each key pose, not only the one you moved. If you key only the moved bone, the other bones keep their old keys, and their interpolation can drift between poses.
Keying with Python
The keyframe_insert() method on a pose bone takes a data path relative to that bone. This script builds a small rig and animates a bend. It runs in a new Blender scene from the Scripting workspace.
import bpy
import math
# Build a two-bone rig (see the earlier chapter on scripting rigs)
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
bpy.ops.object.mode_set(mode='EDIT')
root = arm_data.edit_bones.new("root")
root.head, root.tail = (0, 0, 0), (0, 0, 1)
child = arm_data.edit_bones.new("child")
child.head, child.tail = (0, 0, 1), (0, 0, 2)
child.parent = root
child.use_connect = True
bpy.ops.object.mode_set(mode='OBJECT')
# Set the animation range
scene = bpy.context.scene
scene.frame_start = 1
scene.frame_end = 48
# Key the child bone: rest, bent, rest
pbone = arm_obj.pose.bones["child"]
pbone.rotation_mode = 'XYZ'
poses = {1: 0.0, 24: 45.0, 48: 0.0}
for frame, degrees in poses.items():
pbone.rotation_euler = (math.radians(degrees), 0, 0)
pbone.keyframe_insert(data_path="rotation_euler", frame=frame)
# Return to frame 1 so the viewport shows the start of the action
scene.frame_set(1)Passing frame= to keyframe_insert() stores the key at that frame without moving the playhead. The value stored is whatever the property holds at the moment of the call, so you must assign the pose first. To key a single channel, pass index. For example, index=0 keys only X.
Setting rotation_mode before keying matters for the reason given above. If you change it after keying, the existing keys stay on the old property.
Common problems
- The rig snaps back when the frame changes. You posed the bone but did not key it. Blender re-evaluates the action and overwrites unkeyed values on animated channels.
- Keys appear but the bone does not move. Check the rotation mode. Keys on
rotation_eulerhave no effect while the bone is in Quaternion mode. - Rotations flip or spin the long way around. Quaternion keys can take the shortest path between two orientations, which may not match what you intended. Euler keys follow each axis separately, so you control the direction, but they risk gimbal lock. In the Graph Editor, the Discontinuity (Euler) Filter fixes sudden 360° jumps in Euler curves.
- Mirrored or copied poses look wrong. Use Copy Pose and Paste Pose Flipped in Pose Mode, which respect the
.Land.Rnaming convention. Pasting onto a rig with different bone names does nothing. - A character slides unexpectedly. Often the root or a control bone has a location key you did not intend. Check the Dope Sheet for channels you did not mean to key.
Keying controls rather than deform bones
In a production rig, animators key control bones, such as IK targets and FK handles. The deform bones follow through constraints or parenting. Keying the controls keeps the action small and makes it reusable. Keying deform bones directly works for simple rigs, but it breaks down once constraints and IK are involved, because the constraints re-evaluate the bone and hide your values.
Exercise
You keyed rotation_euler on a bone at frames 1 and 24, and the animation plays correctly. A colleague then sets the bone's rotation mode to Quaternion, and the bone stops moving, though the keys are still visible in the Dope Sheet. Why, and what are two ways to fix it?
Show answer
The keys are on the rotation_euler property, but in Quaternion mode Blender evaluates rotation_quaternion, so the Euler curves have no effect. Fix it either by setting the rotation mode back to XYZ Euler, or by re-keying the pose on rotation_quaternion (and deleting the unused Euler keys).
Exercise
In a script, you call pbone.keyframe_insert(data_path="rotation_euler", frame=24) before assigning the bent rotation. What value is stored at frame 24?
Show answer
The value the bone has at the time of the call, which is the old rotation. keyframe_insert() stores the current property value, so you must assign the pose first and then insert the key.