I want to delete all drivers on object in Blender 2.8. I am quite new to the scripting and the only code I have found is this:
import bpy ob = bpy.context.active_object drivers_data = ob.animation_data.drivers for dr in drivers_data: ob.driver_remove(dr.data_path, -1) But it doesn't work. I think there are some little changes needed for Blender 2.8 and later.
Thank you for any help.
EDIT:
After some tries I found out, this code actually works, but only on transform drivers, etc. I need this script to work on shape keys drivers. Basically, I need to delete all drivers (channels) like I would in the drivers editor.
In the end I figured this out! Here is the functioning code:
import bpy fcurves = bpy.data.shape_keys["Key"].animation_data.drivers for fc in fcurves: fcurves.remove(fcurves[0])
'NoneType' object has no attribute 'drivers'. Can someone please show how to modify this for Blender 2.79 ?? $\endgroup$