[Bf-blender-cvs] [90449f9] master: Another fix for T40230/T40290: Object tags were not properly initialized before entering the recursion check.
Lukas Tönne
noreply at git.blender.org
Fri May 23 09:35:10 CEST 2014
Commit: 90449f99503c9fddeb683511e8a3b3850aacb1ec
Author: Lukas Tönne
Date: Fri May 23 09:26:29 2014 +0200
https://developer.blender.org/rB90449f99503c9fddeb683511e8a3b3850aacb1ec
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.
===================================================================
M source/blender/editors/object/object_group.c
===================================================================
diff --git a/source/blender/editors/object/object_group.c b/source/blender/editors/object/object_group.c
index bf43884..47b5f16 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;
}
More information about the Bf-blender-cvs
mailing list