diff options
author | Campbell Barton <ideasman42@gmail.com> | 2008-01-19 18:13:42 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2008-01-19 18:13:42 +0300 |
commit | 7b6c88473c02d97485970390086395b515be653e (patch) | |
tree | cc3d0ac9f256ac8a46598a2b9ac64ef7ad1c20c3 /source/blender/blenkernel/intern/group.c | |
parent | c8841a7f2f0e885335295b3cda34097e117d0edb (diff) |
find_group would only return the first group, this let to the assumption that an object was only in 1 group, made it easy to loop through all groups an object is in.
group = NULL;
while( (group = find_group(base->object, group)) ) {
...
}
Diffstat (limited to 'source/blender/blenkernel/intern/group.c')
-rw-r--r-- | source/blender/blenkernel/intern/group.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/group.c b/source/blender/blenkernel/intern/group.c index 201d93220f9..3a64f8c8c34 100644 --- a/source/blender/blenkernel/intern/group.c +++ b/source/blender/blenkernel/intern/group.c @@ -164,9 +164,12 @@ int object_in_group(Object *ob, Group *group) return 0; } -Group *find_group(Object *ob) +Group *find_group(Object *ob, Group *group) { - Group *group= G.main->group.first; + if (group) + group= group->id.next; + else + group= G.main->group.first; while(group) { if(object_in_group(ob, group)) |