diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2014-05-23 11:26:29 +0400 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2014-05-23 11:28:46 +0400 |
commit | 90449f99503c9fddeb683511e8a3b3850aacb1ec (patch) | |
tree | f920aaab9bd64b3b0ced869a07de521538d8878e /source/blender/editors/object | |
parent | 01f5845778dd75c67b523d4f0d74a87f95492626 (diff) |
Another fix for T40230/T40290: Object tags were not properly initialized
before entering the recursion check.
Now use group tags instead of object tags, which could be a little more
efficient and was used before this patch too.
Diffstat (limited to 'source/blender/editors/object')
-rw-r--r-- | source/blender/editors/object/object_group.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/source/blender/editors/object/object_group.c b/source/blender/editors/object/object_group.c index bf43884bef7..47b5f1605e7 100644 --- a/source/blender/editors/object/object_group.c +++ b/source/blender/editors/object/object_group.c @@ -76,28 +76,29 @@ static bool group_link_early_exit_check(Group *group, Object *object) static bool check_object_instances_group_recursive(Object *object, Group *group) { - if ((object->id.flag & LIB_DOIT) == 0) { - /* Cycle already exists in groups, let's prevent further crappyness */ - return true; - } - /* flag the object to identify cyclic dependencies in further dupli groups */ - object->id.flag &= ~LIB_DOIT; - if (object->dup_group) { - if (object->dup_group == group) + Group *dup_group = object->dup_group; + if ((dup_group->id.flag & LIB_DOIT) == 0) { + /* Cycle already exists in groups, let's prevent further crappyness */ + return true; + } + /* flag the object to identify cyclic dependencies in further dupli groups */ + dup_group->id.flag &= ~LIB_DOIT; + + if (dup_group == group) return true; else { GroupObject *gob; - for (gob = object->dup_group->gobject.first; gob; gob = gob->next) { + for (gob = dup_group->gobject.first; gob; gob = gob->next) { if (check_object_instances_group_recursive(gob->ob, group)) return true; } } + + /* un-flag the object, it's allowed to have the same group multiple times in parallel */ + dup_group->id.flag |= LIB_DOIT; } - /* un-flag the object, it's allowed to have the same group multiple times in parallel */ - object->id.flag |= LIB_DOIT; - return false; } |