[Bf-blender-cvs] [e80cbdac331] master: Fix T65502: Crash when moving Collection into disabled Collection

Dalai Felinto noreply at git.blender.org
Wed Jun 5 00:34:59 CEST 2019


Commit: e80cbdac331a3f9b67217ed9fcb5235c447d0c0f
Author: Dalai Felinto
Date:   Tue Jun 4 17:42:38 2019 -0300
Branches: master
https://developer.blender.org/rBe80cbdac331a3f9b67217ed9fcb5235c447d0c0f

Fix T65502: Crash when moving Collection into disabled Collection

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

M	source/blender/blenkernel/intern/collection.c

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

diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c
index e8d82ade7d3..03bae118f0f 100644
--- a/source/blender/blenkernel/intern/collection.c
+++ b/source/blender/blenkernel/intern/collection.c
@@ -1281,7 +1281,16 @@ bool BKE_collection_move(Main *bmain,
         view_layer, collection);
 
     if (layer_collection) {
-      layer_collection->flag = POINTER_AS_INT(BLI_ghashIterator_getValue(&gh_iter));
+      /* We treat exclude as a special case.
+       *
+       * If in a different view layer the parent collection was disabled (e.g., background)
+       * and now we moved a new collection to be part of the background this collection should
+       * probably be disabled.
+       *
+       * Note: If we were to also keep the exclude flag we would need to re-sync the collections.
+       */
+      layer_collection->flag = POINTER_AS_INT(BLI_ghashIterator_getValue(&gh_iter)) |
+                               (layer_collection->flag & LAYER_COLLECTION_EXCLUDE);
     }
   }



More information about the Bf-blender-cvs mailing list