0
$\begingroup$

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: enter image description here

$\endgroup$

1 Answer 1

0
$\begingroup$

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:

  1. create or open a (new) Scripting Workspace view
  2. In the text editor panel, click on +New
  3. copy and paste the above script
  4. Menu :: Text :: Run Script
$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .