0
$\begingroup$

How can I correctly group multiple objects and have them behave as a unit. I tried the following

sceptre = bpy.data.objects['sceptre']
ring = bpy.data.objects['ring']
Group(sceptre,'wizards')
Group(ring,'wizards')

WITH

def Group(obj0,groupName):
    if not groupName in bpy.data.groups:
        bpy.ops.group.create(name=groupName)
    bpy.context.scene.objects.active = obj0
    bpy.ops.object.group_link(group=groupName)

AND

def Group(obj0,groupName):
    if not groupName in bpy.data.groups:
        group = bpy.data.groups.new(groupName)
    else:
        group = bpy.data.groups[groupName]
    if not obj0.name in group.objects:
        group.objects.link(obj0)

The object property pane shows the new group name for each object under the Add to Group tab with the last object outlined in green after running the script but the objects do not move as a unit when I select and drag either of them like it does when manually grouped with Ctrl + G.

$\endgroup$
1
$\begingroup$

I finally realised I was the one making the mistake, called a blender guru and realised grouped objects didn't move together with the keyboard shortcut so it was just the selection I used to group the objects I was misinterpreting as the group behaviour after I moved the objects together afterwards.

After surfing the web I realised it was either the parenting property or I simply press a keyboard shortcut which brings a dropdown list to choose group and select all objects in it so I can translate at once.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.