Script to transfer weights from one mesh to multiple objects?

You can do something like this as shown in the script. However what is the name of the operator? If you head over to the scripting window, you can apply the operator once too see how is called in the info window, then you can copy directly this entry into the loop and change input arguments accordingly.

import bpy

# select all objects to be used as targets
# but select the source object last
# so is set as the active

selected_object = bpy.context.active_object

# this list of objects conists of all the selected objects
# but the source object (the active) is excluded
# (select from index 1 -- second position | up to last
other_objects = bpy.context.selected_objects[1:]

# and now loop all selected objects
for o in other_objects:
    print('combine', selected_object.name, 'with', o.name)
    o.location = selected_object.location
2 Likes