Sub topic 12
F-curve modifiers: Cycles, Noise and more
An F-curve modifier changes the value of a curve without changing its keyframes. The keys stay where you put them, and the modifier computes extra motion on top of them at evaluation time. This is how you make a looping walk from one stride, add handheld shake to a camera, or ramp a value up forever. You edit the modifier's settings, not a pile of keys.
This chapter assumes you can open the Graph Editor, select channels, and read a curve as value against frame. It also assumes you know what extrapolation does outside the keyed range, since the Cycles modifier builds on that idea.
How modifiers work
Each F-curve has its own modifier stack. Blender evaluates the stack from top to bottom. Each modifier takes the result of the one above it and changes it, so the order matters. A Cycles modifier above a Noise modifier repeats the keyed shape and then adds noise to every repeat. Reversing them gives a different result in some cases, because Noise then runs on the unrepeated curve.
Modifiers are stored on the F-curve, so they belong to one channel only. If you want shake on X, Y and Z location, each of the three curves needs its own modifier. Because the keys are untouched, you can mute or delete a modifier at any time and get your original curve back.
Adding and managing modifiers
Open the Graph Editor and select the channel you want. Press N to open the sidebar and switch to the Modifiers tab. Use the Add Modifier menu to pick a type. You can also use Channel > Add F-Curve Modifier (Ctrl+Shift+M) in the Graph Editor menu.
Each modifier appears as a panel with these shared controls:
- The enable checkbox turns the modifier on or off without deleting it.
- The eye-style mute toggle in the panel header silences the modifier while keeping its settings.
- The X button removes it.
- Restrict Frame Range limits the effect to a start and end frame, with optional blend in and blend out.
- Influence lets you reduce the modifier's strength from full effect down to none.
The menu has an option to only add the modifier to the active curve. Without it, the modifier is added to all selected curves, which is quick for X, Y and Z shake but a surprise if you had other channels selected by accident.
The Cycles modifier
Extrapolation can repeat a curve (Cyclic extrapolation is a setting you can pick on the curve), but the Cycles modifier gives you more control. You choose separate behavior before and after the keyed range, and you can limit the number of repeats.
The settings are:
| Setting | Options | Effect |
|---|---|---|
| Before Mode / After Mode | No Cycles, Repeat Motion, Repeat with Offset, Repeat Mirrored | How the curve continues outside the key range |
| Count (before and after) | 0 or more | Number of repeats. 0 means repeat forever |
The three modes behave differently:
- Repeat Motion plays the same keyed segment again and again. The end value jumps back to the start value at each loop point unless the first and last keys match.
- Repeat with Offset adds the net change of the segment to each repeat. A walk cycle that moves an object forward by 2 units per stride keeps traveling forward, with no jump.
- Repeat Mirrored plays the segment forward, then backward, then forward. This suits a pendulum or a breathing motion.
The most common error is a visible pop at each loop point. It happens when the first and last keyframes have different values or different slopes. To fix it, make the last key's value equal to the first key's value, and set both handles so the curve enters and leaves smoothly. Auto Clamped handles on a repeated curve can still leave a small kink, so check the join in the Graph Editor.
The Noise modifier
Noise adds pseudo-random variation to the value. It is the standard way to get camera shake, a flickering light, or a hand that never sits perfectly still.
| Setting | What it does |
|---|---|
| Blend Type | How noise combines with the curve: Replace, Add, Subtract, Multiply |
| Scale | Length of the noise features in frames. A larger value gives slower wobble |
| Strength | Amplitude of the noise, in the units of the property |
| Offset | Shifts the noise pattern in time |
| Phase | Changes the noise pattern without shifting it in time |
| Depth | Adds finer detail layers on top of the base noise |
Strength is measured in the property's own units. A strength of 0.2 on location is 0.2 meters, which is huge on a small prop, and 0.2 on rotation is 0.2 radians, which is about 11 degrees. Start small and raise the value until the effect reads.
Use Add as the blend type for shake on top of animation. With Replace, the noise overwrites the keyed motion, which is rarely what you want. If three axes use the same Scale, Strength and Phase, they will wobble in lockstep. Give each axis a different Phase or Offset so the motion looks organic.
Other modifier types
Blender includes several more modifiers. They are less common, but each solves a specific problem.
| Modifier | Use |
|---|---|
| Generator | Builds a curve from a polynomial or factorized expression. With Additive on, it adds to the existing curve; otherwise it replaces it |
| Built-In Function | Produces a sine, cosine, tangent, square root, natural log or normalized sine wave, with amplitude, phase and offset controls |
| Envelope | Remaps the curve between control points, so you can squash or stretch the curve's range over time |
| Limits | Clamps the output between minimum and maximum values for X (frame) or Y (value) |
| Stepped Interpolation | Holds the value for N frames at a time, giving a stop-motion or choppy look |
A few uses:
- A Built-In Function sine wave with Additive enabled makes a smooth bobbing motion, such as a floating boat, without any keyframes beyond a single resting key.
- A Generator with a linear coefficient produces a constant rate of change, such as a wheel spinning at a fixed speed. Set the first coefficient to the starting value and the second to the change per frame.
- Stepped Interpolation with a step size of 2 turns smooth animation into animation "on twos", a common stylized look.
- A Limits modifier stops a value from going below zero after a Noise modifier, so a light never gets negative energy.
Working with modifiers in practice
Modifiers change what the curve looks like in the Graph Editor. The editor draws the result of the stack, so a cycled curve extends across the timeline. The keyframes still show only in the keyed range.
There are some behaviors to know about:
- Editing keys on a curve with a Generator or Built-In Function set to replace the curve has no visible effect, because the modifier overrides the keyed value. Switch on Additive, or mute the modifier, to see your keys again.
- Bezier handle editing is disabled on curves with some modifiers active. Mute the modifier, edit the keys, then unmute it.
- Dope Sheet keyframes do not show modifier output. A shaking camera looks still in the Dope Sheet because only the keys are drawn.
- Rendering uses the full stack. If the viewport shows the shake, the render will too, as long as the modifier is not muted.
When you need the modifier's result as real keys, for example to export to a game engine that cannot read modifiers, bake the curve. The cleanup chapter covers Bake Sound to F-Curves and the Bake Keyframes operation for that purpose. Remove the modifier after baking so the effect is not applied twice.
Modifiers from Python
You can create modifiers from a script. The modifiers.new call takes the modifier type as a string, and the returned object has the settings as properties. The example below loops one keyed X-location curve forever and adds shake. It uses action.fcurves, which applies to Blender versions before the slotted-actions change, so check the API docs for your version.
import bpy
obj = bpy.context.object
obj.location = (0.0, 0.0, 0.0)
obj.keyframe_insert(data_path="location", frame=1)
obj.location = (0.0, 0.0, 0.0)
obj.keyframe_insert(data_path="location", frame=1)
obj.location = (1.0, 0.0, 0.0)
obj.keyframe_insert(data_path="location", frame=12)
obj.location = (0.0, 0.0, 0.0)
obj.keyframe_insert(data_path="location", frame=24)
fcurve = obj.animation_data.action.fcurves.find("location", index=0)
cycles = fcurve.modifiers.new(type='CYCLES')
cycles.mode_before = 'REPEAT'
cycles.mode_after = 'REPEAT'
noise = fcurve.modifiers.new(type='NOISE')
noise.blend_type = 'ADD'
noise.scale = 5.0
noise.strength = 0.05
print([m.type for m in fcurve.modifiers])The modifiers are listed in stack order, so the script prints ['CYCLES', 'NOISE']. Setting mute = True on a modifier object disables it without deleting it, and fcurve.modifiers.remove(modifier) deletes it.
Common errors
- A loop that pops at the join: the first and last keyframe values or slopes differ. Match them.
- Noise has no visible effect: Strength is too small for the property's units, or the blend type is Replace on a curve with no usable keys.
- Edited keys seem to do nothing: a Generator or Built-In Function modifier in replace mode overrides them.
- Modifier changes only one axis: modifiers belong to a single F-curve, so repeat the setup on each channel.
- Cycles only repeats once: the Count is set to a value above 0. Set it to 0 for endless repeats.
Exercise
A cube moves along X from 0 to 3 over frames 1 to 24 with keys at both ends. You want it to keep moving 3 units per 24 frames forever, with no jump back at frame 25. Which modifier and mode do you use, and what do you set the Count to?
Show answer
Add a Cycles modifier and set the After Mode to Repeat with Offset. Set the After Count to 0 so it repeats forever. Repeat with Offset adds the 3-unit net change to each repeat, so the cube continues forward instead of jumping back to 0.
Exercise
You add a Noise modifier with Strength 0.3 to a camera's X rotation and the camera spins wildly. Why, and what is a sensible first fix?
Show answer
Rotation is measured in radians, so 0.3 is about 17 degrees, which is a large swing. Lower the Strength to around 0.01 to 0.03 (roughly 0.5 to 2 degrees) and raise it until the shake reads well. Also set Blend Type to Add so the noise sits on top of the keyed rotation.