I'm trying to delete the driver of specific shape keys. I have used the code below, which deletes a shape key, using key_idx
to select an entry key from the list.
fcurves.remove(fcurves[key_idx])
However, the 'index' values of that list are defined by the drivers rather than the shape keys. That is to say, fcurves.remove(fcurves[3])
will find the third shape-key-with-a-driver, and not the driver of the third shape key.
This means that I can't use key_idx = active_shape_key_index
to delete a specific shape key, since I've no way of telling how many previous shape keys have drivers, if any.
There's also bpy.ops.anim.driver_button_remove(all=True)
, but that just returns {'CANCELLED'}
How can I specify a shape key driver to be deleted, when it's unknown at what 'driver index' that driver sits at?