1
$\begingroup$

I separated some bones from a armature which has lots of bone drivers, and when I separated some bones, it made a new armature with old armature's drivers. After editing I joined old armature to new armature again, and here is a problem. It also merges old armature's drivers with new armature's drivers, then now all of this newly created armature's drivers are doubled. My driver editor is really messy and this armature's animation is really cpu intensive right now.

I would like to delete all duplicated drivers, but is it possible? Do I need to use python script or add-on?

$\endgroup$

1 Answer 1

0
$\begingroup$

I wrote this script and it works. This script deletes all duplicated drivers of selected armature. If you know something better or find something wrong in my script please tell me.

import bpy

driver_list = list()
ob = bpy.context.active_object 

for dr in ob.animation_data.drivers:
    driver_id = "Object name = "+ob.name+" Path = "+dr.data_path+"["+str(dr.array_index)+"]"+" Driver expression = "+dr.driver.expression
    if driver_id not in driver_list:
        driver_list.append(driver_id)
    else:
        print("Deleting Unwanted Drivers",driver_id,)
        ob.driver_remove(dr.data_path,dr.array_index)
$\endgroup$

You must log in to answer this question.

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