Sub topic 13
Cleaning, Decimating and Baking Curves
Assume you can insert keyframes, use the Timeline and Dope Sheet, and navigate the Graph Editor. You should also understand that an F-curve stores one animated property over time.
Why reduce or bake keyframes?
Animation often contains more keys than necessary. Motion-capture data may create a key on every frame. Repeated editing may leave keys that do not change the visible result. Extra keys make curves harder to read and harder to edit.
Blender provides three useful operations:
| Operation | Main purpose | Result |
|---|---|---|
| Clean Keyframes | Remove redundant keys | A simpler curve with nearly the same motion |
| Decimate Keyframes | Reduce key density by an error limit | Fewer keys, with controlled approximation |
| Bake Keyframes | Sample evaluated motion | Explicit keys for each chosen frame interval |
Cleaning is usually the safest first step. Decimation can change the curve more noticeably. Baking is useful when motion comes from constraints, modifiers, drivers, or other procedural sources.
Clean redundant keys
In the Graph Editor, select the channels or keyframes you want to simplify. Use Key > Clean Keyframes. Blender removes keys that are unnecessary within its tolerance.
Before cleaning:
- Save the file or duplicate the action.
- Select only the curves you intend to change.
- Keep an original copy if the motion is difficult to recreate.
Cleaning works well on gentle motion. It may remove subtle changes that matter at a small scale, so inspect the result at the final camera distance.
Decimate with a controlled error
Use Key > Decimate Keyframes to reduce the number of selected keys. The operation uses an error threshold. A small threshold preserves the original shape more closely and removes fewer keys. A larger threshold produces a smaller curve but can flatten peaks, remove small overshoots, or change timing.
Decimate one logical group at a time, such as all three location channels. Then scrub the animation and compare important poses. Do not judge the result only by the number of remaining points.
Bake evaluated motion
Baking samples the motion at regular frame intervals and writes ordinary keyframes. This converts a result that depends on evaluation into editable keyframe data.
Use Object > Animation > Bake Action when you need to capture constraints or other evaluated motion. Set the frame range and Frame Step. A step of 1 creates a key on every frame. A larger step creates fewer keys but may miss fast changes. Enable options such as Only Selected when appropriate, and review whether the bake should clear constraints or other source data.
A small procedural bake can also be created with Python:
import bpy
import math
scene = bpy.context.scene
obj = bpy.context.object
if obj is None:
obj = bpy.data.objects.new("BakedMotion", None)
scene.collection.objects.link(obj)
obj.animation_data_clear()
scene.frame_start = 1
scene.frame_end = 48
for frame in range(scene.frame_start, scene.frame_end + 1):
scene.frame_set(frame)
obj.location.x = 2.0 * math.sin(frame * 0.2)
obj.keyframe_insert(data_path="location", index=0, frame=frame)
scene.frame_set(scene.frame_start)This samples a sine-wave motion on every frame. Afterward, you can clean or decimate the generated X-location curve.
A practical order
Use this sequence when preparing animation for delivery:
- Clean obvious redundant keys.
- Decimate only if the curve is still too dense.
- Bake when another system must receive explicit keyframes.
- Scrub the full range and inspect fast motion, contacts, peaks, and holds.
- Save a separate version after approval.
Exercise
A constrained object moves correctly, but you must send its motion as ordinary keyframes. Which operation should you use, and what should you preserve first?
Show answer
Use Bake Action over the required frame range. Preserve the original constrained version before baking, because the bake may replace or disconnect the source workflow.