Sub topic 1
From Keyframes to Actions: Where Animation Data Lives
Prerequisites
This chapter assumes you can navigate the 3D Viewport, insert keyframes with I, and use the Timeline or Dope Sheet. Python examples assume Blender 4.x. Check the API documentation for your version, because Blender changed how actions store F-curves in recent releases.
Keyframes and actions
A keyframe stores a property value at one frame. Blender stores the keyframes for an object in an action, a data block attached to the object's animation data. You can view and swap the active action in the Action Editor, which is a mode of the Dope Sheet.
What an F-curve is
Blender creates one F-curve for each animated property channel. An F-curve maps one value to time. If you key X, Y and Z location, the action holds three F-curves. Each one has a data path (location) and an array index (0, 1 or 2).
import bpy
obj = bpy.context.object
action = obj.animation_data.action
for fc in action.fcurves:
print(fc.data_path, fc.array_index, len(fc.keyframe_points))Run this on an object that already has keyframes.
Getting around the Graph Editor
Press Ctrl+Tab in the Dope Sheet to switch to the Graph Editor. The left panel lists channels. Press Home to frame all curves. Ctrl+middle-mouse drag zooms the view.
Managing channels
Click a channel name to select it. In the channel list, the eye icon hides a curve from the graph, the padlock locks it against edits, and the checkbox mutes it. Hiding and muting do not delete data. Groups collapse related channels, such as the X, Y and Z location curves, into one row.
> Hidden, locked and muted channels still exist in the action. Check these toggles when a curve seems unresponsive.
Selecting and transforming keyframes and handles
Click a keyframe to select it. Drag a box with B, or press A to select all. Press G to grab, R to rotate, and S to scale the selection. Click a Bezier handle to move it separately from its keyframe.
| Key | Action |
|---|---|
| G | Grab (move) selected keys |
| R | Rotate selected keys around the pivot |
| S | Scale selected keys around the pivot |
Exercise
Exercise
An object has keyframes on X, Y and Z location. How many F-curves does its action contain, and how do you tell which one is X?
Show answer
It contains three F-curves. The X curve has data path "location" and array index 0, which you can check with the Python snippet above.