I need to clear all the F-Curve modifiers in Blender. I currently have the "Stepped interpolation" on every channel in the graph editor. I need a way to remove them all without going through each one manually.
Here is my current display:
1 Answer
$\begingroup$
$\endgroup$
I share the following python script that I modified to remove all "Stepped interpolation" F-Curve modifiers on all objects. (I had been testing for 'CYCLES' modifiers to remove.) And you can edit to look at only bpy.context.selected_objects, instead of all objects.
import bpy
for o in bpy.data.objects:
if o.animation_data is not None and o.animation_data.action is not None:
action = o.animation_data.action
# Iterate over all F-Curves
for fcu in action.fcurves:
# Iterate over all F-Curve modifiers
for mod in fcu.modifiers:
# Only act upon "Stepped interpolation" modifiers
if mod.type == 'STEPPED':
print( fcu, mod, mod.type )
fcu.modifiers.remove( mod )
If you're not used to python scripting:
- create or open a (new) Scripting Workspace view
- In the text editor panel, click on +New
- copy and paste the above script
- Menu :: Text :: Run Script