Delete the cycle animation modifier from several objects

How can I delete the cycle animation modifier on several objects at the same time? (as opposed to doing it one at a time)

• I presume you mean the 'animation modifiers'? If so, make sure you make that clear in the question. They're quite different from regular modifiers. :) – Ray Mairlot Oct 14 '15 at 16:46

I wrote the following python script which should accomplish your mission (http://web.purplefrog.com/~thoth/blender/python-cookbook/remove-action-modifiers.html):

import bpy

def mission1(obj):
if obj.animation_data is None or obj.animation_data.action is None:
return

action = obj.animation_data.action

for fc in action.fcurves:
print(fc.data_path)
for mod in fc.modifiers:
if mod.type == 'CYCLES':
fc.modifiers.remove(mod)

for obj in bpy.context.selected_objects:
mission1(obj)


One shortcoming of this script is that the fcurves window does not immediately update to display the alterations, although it does update when you start scrubbing the timeline.