I'm trying to add objects to previously created groups from a Python script.
What do I do?
It is actually pretty simple:
import bpy grp = bpy.data.groups.get('bacon') obj = bpy.data.objects['Cube'] grp.objects.link(obj)
This avoid the hassle of setting up the context for
You can do as follows:
Assign it to an existing group
bpy.context.scene.objects.active = bpy.data.objects['Your Object'] bpy.ops.object.group_link(group='Your Group')