From e80cbdac331a3f9b67217ed9fcb5235c447d0c0f Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Tue, 4 Jun 2019 17:42:38 -0300 Subject: Fix T65502: Crash when moving Collection into disabled Collection --- source/blender/blenkernel/intern/collection.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'source/blender/blenkernel/intern') 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); } } -- cgit v1.2.3