Sub topic 8
Auto Keying
This chapter covers Auto Keying: what it records, when it records, and how to avoid its common mistakes. It assumes you can insert a keyframe manually (I on a property or in the viewport), you know the Timeline header layout, and you understand that an animated property is re-evaluated whenever the current frame changes. Menu labels and the exact placement of options vary a little between Blender 2.8 and 4.x. The behavior described here is the same across them.
What Auto Keying does
Auto Keying is a scene-level switch. While it is on, changing an animatable property at the current frame inserts or updates a keyframe for that property. You don't press I.
The switch is the round record button at the left of the playback controls in the Timeline header. When it is on, the button turns red. The 3D Viewport and Timeline also get a red border, so you can see that edits are being recorded.
Without Auto Keying, you pose, then key, then move on. With it, you move to a frame, pose, and move to the next frame. This suits pose-to-pose work such as a bouncing ball or a character's arm swing, where you change many values at many frames.
What gets keyed
Auto Keying records properties you edit through the interface. Three kinds of edit trigger it:
- Transform operators in the viewport (G, R, S, and the gizmos). The channels for the transformed property are keyed. Moving an object keys its location, and rotating it keys its rotation.
- Edits to fields in the Properties editor, such as typing a new value in a Location field or dragging a slider.
- Edits to bone transforms in Pose Mode.
Only properties that can be animated are affected (see the chapter on animatable properties). A property that is not animatable, such as an object's name, is never keyed.
Auto Keying keys the property you changed. It does not key everything on the object. If you move an object, rotation and scale stay unkeyed unless you edit them too. This keeps the Dope Sheet clean, but it also means you must decide which channels should exist before you start posing.
The next table shows what happens when you edit an object's location at frame 10, depending on the animation already present.
| Situation before the edit | Result with Auto Keying on |
|---|---|
| Location has no keyframes | A first keyframe appears at frame 10 (the location channels are created). |
| Location has keyframes, but none at frame 10 | A new keyframe is inserted at frame 10. |
| Location has a keyframe at frame 10 | That keyframe's value is replaced. |
The second row is the one that surprises people. Editing an animated property at an unkeyed frame does not "bend" the curve. It adds a new key.
The edit-and-key loop
Work through the loop on a simple case:
- Select a cube. Set the frame range to 1–48 and the current frame to 1.
- Turn on Auto Keying. Press G, Z, type 0, and press Enter. Setting a value, even an unchanged one, records a key at frame 1.
- Go to frame 24. Move the cube up with G, Z, 2, Enter. A keyframe appears at frame 24.
- Go to frame 48. Move the cube back to Z = 0.
- Turn Auto Keying off and scrub the Timeline. The cube rises and falls.
With Auto Keying off, you could not have skipped the key insertion step. If you moved the cube at frame 24 and then changed frames, the cube would snap back to its animated value, because the unkeyed edit was never stored.
Reading the field colors
The colored fields in the Properties editor tell you what Auto Keying has and has not recorded:
- Yellow: a keyframe exists on this frame.
- Green: the property is animated, but there is no key on this frame.
- Orange: the value was changed and differs from the animation at this frame, so the change is not stored yet.
With Auto Keying on, you should rarely see orange for long, since each edit becomes a key at once. If a field stays orange, either Auto Keying is off or the edit was made to something outside its reach.
Options that change the behavior
A dropdown arrow next to the record button opens the keying options. The exact layout depends on your version, so check the popover in your build. The options below are the ones that matter most.
- Keyframe type: the type (Keyframe, Breakdown, and so on) given to keys that Auto Keying inserts. Set it before you start if you want breakdowns.
- Active Keying Set: when a keying set is active and this option is on, Auto Keying records only the properties in that set. This is useful for limiting a character rig to a few controls.
- Only Insert Needed: skips keys that would not change the curve. This reduces clutter, but it can drop a key you wanted as a hold.
- Visual Keying (in Preferences, under Animation): records the result of constraints and drivers rather than the raw property value.
- Replace versus Add & Replace (older versions): older versions have a mode choice that controls whether existing keys are replaced or whether new ones may be added.
Because the options differ, test your settings with a throwaway object before animating something real.
Common errors
Stray keys from leaving it on. The most frequent mistake is forgetting that Auto Keying is on. You nudge an object to adjust the layout, and a key appears at the current frame. If you then change frames, the nudge persists only at that one frame, and the object jumps. Check the red border before you do non-animation edits.
Keys on the wrong frame. Auto Keying uses the current frame. If the playhead sits at frame 37 when you meant frame 12, the key lands at 37. Before each pose, check the frame number.
Unwanted keys on channels you did not mean to animate. Moving the object with a transform operator keys all the channels of that property (X, Y, and Z location), even if you moved on one axis. If one axis should stay constant, accept the extra keys or delete those F-curves in the Dope Sheet.
Expecting a hold. If a property has a key at frame 1 and a key at frame 24, it interpolates between them. To make it stay still, you need a key with the same value at both ends of the hold. Auto Keying does not add it for you, and Only Insert Needed can remove it.
Edits that Auto Keying does not catch. Changes made by a script, by drivers, or by non-interface paths may not trigger keying the way a UI edit does. For scripts, call keyframe_insert yourself.
Controlling it from Python
You can read and set the switch on the scene's tool settings:
import bpy
tool_settings = bpy.context.scene.tool_settings
print("Auto Keying is on:", tool_settings.use_keyframe_insert_auto)
tool_settings.use_keyframe_insert_auto = FalseThis is useful at the start of a script that moves things around, so that your scripted edits and any later UI edits don't mix with automatic recording.
Summary
Auto Keying records edits to animatable properties as keyframes at the current frame. It creates a key if none exists, replaces the value if one does, and keys only the properties you edit. It speeds up pose-to-pose animation, and it is a common source of accidental keys. Know which frame you are on, know whether the button is red, and review the result in the Dope Sheet.
Exercise
You turned on Auto Keying, went to frame 30, and moved an object that already has location keys at frames 1 and 48 but none at frame 30. Then you moved to frame 31. What do you see in the Dope Sheet, and why?
Show answer
A new location keyframe appears at frame 30 between the keys at 1 and 48. Auto Keying inserts a key at the current frame when you edit an animated property at an unkeyed frame, so the curve now passes through your edited value at frame 30. At frame 31 the object is evaluated from the updated animation, so it does not snap back to the old curve.
Exercise
You finish animating, but when you later adjust an object's position for layout, the object jumps when you change frames. What is the likely cause, and what are two ways to fix it?
Show answer
Auto Keying was probably still on, so the adjustment was keyed at the current frame and now differs from the surrounding animation. Delete the stray keyframe in the Dope Sheet (or undo), and turn Auto Keying off before doing layout edits. With it off, you can also set the property's keys deliberately.