1
$\begingroup$

I think it is a special case. If I remove objects form a group that group still exists without objects. So I can add objects to that group via Properties / Object / Groups / Add to Group button. The list will show the name of the existing groups so I can add object to one by one.

So the question: how can I add more than one objects to an empty group (not one by one)?

$\endgroup$
4
$\begingroup$

Select your objects you want to add to the empty group and run Python script:

import bpy

group_name = "James Bond"
for o in bpy.context.selected_objects:
    bpy.data.groups[group_name].objects.link(o)
$\endgroup$
  • $\begingroup$ The script working. Thanks! The weird thing is that I run the script in a test scene and the group is appeared in the Outliner / Groups with the linked objects. But when I reloaded the blender file the group was gone. $\endgroup$ – Prag Feb 21 '17 at 5:08
2
$\begingroup$

As far as I know you really can't do that.

"If I remove objects form a group that group still exists without objects"

Actually he group doesn't really exist anymore. It's name is listed because the datablock hasn't been erased yet. If you save your file close blender and reopen the Group name will be gone.

Only thing you can do is select all the objects you want to add to the "ghost" group (make sure you click at least one of them to make it active), add one via the menu in Properties Window > Object > Groups > Add to Group, then with the cursor hovering the 3D View press Ctrl + L > Link > Group.

Have in mind though, that if any of the other objects already belonged to any groups previously they will be removed from them to match the active object's.

$\endgroup$
  • $\begingroup$ Thanks for the answer. Actually I experienced that I reloaded the blender file and the empty group was still there. For test I made a group with couple of objects and I checked the data-blocks. It seems group's users are not the objects because it had only one user and it contained couple of objects. $\endgroup$ – Prag Feb 21 '17 at 5:03

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.