I use Python to create some shapes in blender. I want to group these shapes together and use the following code to do this:
import bpy bpy.ops.group.create(name= "NewGroup") bpy.ops.object.group_link(group="NewGroup") For i in range (1,3,1): tempobject = bpy.data.objects["Cube" + str(i)] bpy.context.scene.objects.active=tempobject bpy.ops.object.group_link(group="NewGroup")
When I try to select a group so that I can join it with the active object:
host_object = bpy.data.objects["Cube1"] bpy.context.scene.objects.active=host_object bpy.ops.object.select_same_group(group="NewGroup") bpy.ops.object.join() # all selected objects join to active object
he does not select any objects within the group.
source share