Sub topic 3
Normalize and view controls for reading small curves
This chapter assumes you can insert keyframes, open the Graph Editor, and set object properties such as location. An F-curve is the curve Blender builds from the keyframes of one property, plotted against time.
Normalize and view controls
When one curve ranges from 0 to 2 and another from 0 to 500, small changes on the first curve are hard to see. Turn on Normalize in the Graph Editor header. Blender then rescales each curve to the range -1 to 1. Press Home to frame all visible keys. Normalize changes only the display, not the stored values.
Extrapolation: what happens outside the keys
Extrapolation sets what a curve does before its first key and after its last key. Constant holds the end value. Linear continues the slope of the end segment. Set it under Channel > Extrapolation Mode (Shift+E).
Polishing motion: overshoot, settle and removing pops
Bezier handles can make a value overshoot its target and then settle back. Auto Clamped handles prevent most of this overshoot. A pop is a sudden jump between two keys. To remove one, select the keys around it and set their handles to Auto Clamped.
F-curve modifiers: Cycles, Noise and more
Modifiers add motion on top of the keys. Cycles repeats the keyed motion. Noise adds random variation. Add them from the Modifiers tab of the Graph Editor sidebar (N).
import bpy
obj = bpy.context.object
fcurve = obj.animation_data.action.fcurves.find("location", index=0)
fcurve.extrapolation = 'LINEAR'
noise = fcurve.modifiers.new(type='NOISE')
noise.scale = 5.0
noise.strength = 0.2Cleaning, decimating and baking curves
Clean removes redundant keys. Decimate removes keys by a ratio, which can change the motion. Bake converts a curve driven by modifiers or drivers into plain keyframes you can edit. Clean before baking to keep the key count low.
Reading and editing F-curves with Python
Each F-curve has a keyframe_points collection. This script sets every key to Bezier with Auto Clamped handles. Newer Blender releases change how actions store F-curves, so check the API docs for your version.
import bpy
obj = bpy.context.object
fcurve = obj.animation_data.action.fcurves.find("location", index=0)
for kp in fcurve.keyframe_points:
kp.interpolation = 'BEZIER'
kp.handle_left_type = 'AUTO_CLAMPED'
kp.handle_right_type = 'AUTO_CLAMPED'
fcurve.update()Drivers: F-curves driven by other values
A driver is an F-curve whose value comes from another property instead of from keyframes. Drivers appear in the Graph Editor under the Drivers mode.
| Control | Where to find it | Effect |
|---|---|---|
| Normalize | Graph Editor header | Scales the display to -1 to 1 |
| Extrapolation | Channel menu | Sets motion outside the keys |
| Cycles modifier | Modifiers tab (N) | Repeats the keyed motion |
Exercise
Which Python call adds a Noise modifier to the X location F-curve?
Show answer
fcurve.modifiers.new(type='NOISE'), where fcurve is found with fcurves.find("location", index=0).