diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2019-06-04 23:42:38 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2019-06-05 01:32:55 +0300 |
commit | e80cbdac331a3f9b67217ed9fcb5235c447d0c0f (patch) | |
tree | 3235453bf55298f317c5270058a18d073e405afa /source/blender/blenkernel/intern | |
parent | fa24ec41aafb89c3d8c29034f2da97fde7507e78 (diff) |
Fix T65502: Crash when moving Collection into disabled Collection
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/collection.c | 11 |
1 files changed, 10 insertions, 1 deletions
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); } } |