diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-07-05 09:25:54 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-07-05 09:28:01 +0300 |
commit | 31d762c3a80da99afa4e3ba6dd308746011de6cb (patch) | |
tree | 030a18be69a4c0ab84a88637a5601687780b6e85 /source/blender/makesrna/intern/rna_layer.c | |
parent | 66684bdff30fdf3fffa02c71c0118b7d714e9b0e (diff) |
Fix T66356: runtime assert disabling a collection
Diffstat (limited to 'source/blender/makesrna/intern/rna_layer.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_layer.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/makesrna/intern/rna_layer.c b/source/blender/makesrna/intern/rna_layer.c index be7985b69a4..1c0ced060d5 100644 --- a/source/blender/makesrna/intern/rna_layer.c +++ b/source/blender/makesrna/intern/rna_layer.c @@ -278,15 +278,18 @@ static void rna_LayerCollection_exclude_update(Main *bmain, Scene *UNUSED(scene) LayerCollection *lc = (LayerCollection *)ptr->data; ViewLayer *view_layer = BKE_view_layer_find_from_collection(scene, lc); - /* Set/Unset it recursively to match the behaviour of excluding via the menu or shortcuts. */ - rna_LayerCollection_exclude_update_recursive(&lc->layer_collections, - (lc->flag & LAYER_COLLECTION_EXCLUDE) != 0); + /* Set/Unset it recursively to match the behavior of excluding via the menu or shortcuts. */ + const bool exclude = (lc->flag & LAYER_COLLECTION_EXCLUDE) != 0; + rna_LayerCollection_exclude_update_recursive(&lc->layer_collections, exclude); BKE_layer_collection_sync(scene, view_layer); DEG_id_tag_update(&scene->id, ID_RECALC_BASE_FLAGS); DEG_relations_tag_update(bmain); WM_main_add_notifier(NC_SCENE | ND_LAYER_CONTENT, NULL); + if (exclude) { + ED_object_base_active_refresh(bmain, scene, view_layer); + } } static void rna_LayerCollection_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) |