diff options
author | Ton Roosendaal <ton@blender.org> | 2008-09-17 21:47:59 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2008-09-17 21:47:59 +0400 |
commit | 3ecbcb5848ced97621ab94fee86a5b6d415d5c17 (patch) | |
tree | c9145054c9493cabf33ce39ced20f3872fbd2341 /source/blender/blenkernel/intern/group.c | |
parent | b4e4ffc0b83a9e4f14d6d81dff424ff49e8f8c56 (diff) |
Bugfix #14412
Outliner option 'unlink group' didn't remove its members, in case the
group members were local in file, a confusing situation happened. Now
it removes members.
Diffstat (limited to 'source/blender/blenkernel/intern/group.c')
-rw-r--r-- | source/blender/blenkernel/intern/group.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/group.c b/source/blender/blenkernel/intern/group.c index 2ffe8590b59..0d2f86bb151 100644 --- a/source/blender/blenkernel/intern/group.c +++ b/source/blender/blenkernel/intern/group.c @@ -91,6 +91,16 @@ void unlink_group(Group *group) ma->group= NULL; } for (sce= G.main->scene.first; sce; sce= sce->id.next) { + Base *base= sce->base.first; + + /* ensure objects are not in this group */ + for(; base; base= base->next) { + if(rem_from_group(group, base->object) && find_group(base->object, NULL)==NULL) { + base->object->flag &= ~OB_FROMGROUP; + base->flag &= ~OB_FROMGROUP; + } + } + for(srl= sce->r.layers.first; srl; srl= srl->next) { if (srl->light_override==group) srl->light_override= NULL; @@ -117,6 +127,9 @@ void unlink_group(Group *group) psys->part->eff_group= NULL; } } + + /* group stays in library, but no members */ + free_group(group); group->id.us= 0; } |