In Blender, a script that just joins as shapes all the objects directly under a particular group. When I selected it normally and executed it, the order became messy, so I used it to access it from the script. Change the "Neutral" part to the object name to which you want to assign ShapeKey and execute.
import bpy
childrenList = bpy.data.objects['ShapeKeyModelGrp'].children
for child in childrenList:
bpy.ops.object.select_all(action='DESELECT')
child.select_set(True)
objectToSelect = bpy.data.objects["Neutral"]
objectToSelect.select_set(True)
bpy.context.view_layer.objects.active = objectToSelect
bpy.ops.object.join_shapes()
Recommended Posts