[PYTHON] In Blender, a script that just joins all objects directly under a particular group

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

In Blender, a script that just joins all objects directly under a particular group
A script that just gets an RSS feed
Script to search all selected object hierarchies in Blender
What's in that variable (when running a Python script)
Get all XYZ tiles that contain a particular geometry
Print the name of the object directly under the object specified in Blender
Let's create a script that registers with Ideone.com in Python.
A shell script that just emails the SQL execution result
A set of script files that do wordcloud in Python3
I wrote a script that splits the image in two