[Bf-blender-cvs] [0fae682d61e] blender-v2.90-release: Fix T79935: Inonsistent simplify behavior when linking collection with objects in sub-collection.

Bastien Montagne noreply at git.blender.org
Thu Aug 20 11:52:17 CEST 2020


Commit: 0fae682d61e131d64c08ba3c16617c66cd4c28f0
Author: Bastien Montagne
Date:   Thu Aug 20 10:37:11 2020 +0200
Branches: blender-v2.90-release
https://developer.blender.org/rB0fae682d61e131d64c08ba3c16617c66cd4c28f0

Fix T79935: Inonsistent simplify behavior when linking collection with objects in sub-collection.

RNA update function would only update objects from 'main' instantiated
collection, not those from sub-collections.

This should be comitted to 2.90 (and backported to 2.83 too).

Maniphest Tasks: T79935

Differential Revision: https://developer.blender.org/D8654

===================================================================

M	source/blender/makesrna/intern/rna_scene.c

===================================================================

diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 4bb7b7d9558..d723642e65a 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -1873,11 +1873,10 @@ static void object_simplify_update(Object *ob)
   }
 
   if (ob->instance_collection) {
-    CollectionObject *cob;
-
-    for (cob = ob->instance_collection->gobject.first; cob; cob = cob->next) {
-      object_simplify_update(cob->ob);
+    FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN (ob->instance_collection, ob_collection) {
+      object_simplify_update(ob_collection);
     }
+    FOREACH_COLLECTION_OBJECT_RECURSIVE_END;
   }
 }



More information about the Bf-blender-cvs mailing list