1
$\begingroup$

I have two characters with corrective shape keys , the one which I get from daz have all driver setup for corrective shape keys . The one I edited have same armature and same shape keys (the have same names on both objects) but now I have to copy all driver from particular shape key to the shape key of my final mesh and that very time consuming and annoying as i have more then 200 shape keys on mesh and I have to do it more many characters.

I found the script which copy all shape keys from one mesh to another I need similar functionality for drives so all the drivers from particular shape key of one object get copied to corresponding shape key of another object.

Shape key transfer Script:

import bpy

def copy_all_shape_keys():
    if len(bpy.context.selected_objects) == 2:
        source = bpy.context.selected_objects[1]
        dest = bpy.context.active_object
        for v in bpy.context.selected_objects:
            if v is not dest:
                source = v
                break
        
        print("Source: ", source.name)
        print("Destination: ", dest.name)
        
        if source.data.shape_keys is None:
            print("Source object has no shape keys!") 
        else:
            for idx in range(1, len(source.data.shape_keys.key_blocks)):
                source.active_shape_key_index = idx
                print("Copying Shape Key - ", source.active_shape_key.name)
                bpy.ops.object.shape_key_transfer()

print("Start")
copy_all_shape_keys()
print("End") 
```
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.