diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2017-02-17 15:08:24 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2017-02-17 16:08:31 +0300 |
commit | 9cb44cbba13817dc981e4d865ec04847f03fb719 (patch) | |
tree | c21a2f6bfd933d73322fb2e5dffd454d46f379d4 /source | |
parent | 7884406f33c91a5161b570ef53d84450e3775a24 (diff) |
Layers: Fix visibility evalution + Unittesting
test_evaluation_visibility_a failed before, but it is now fixed
test_evaluation_visibility_b passed before and was used as control to make sure it was not broken
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/layer.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/layer.c b/source/blender/blenkernel/intern/layer.c index d08801477a2..7b8ad5eaa83 100644 --- a/source/blender/blenkernel/intern/layer.c +++ b/source/blender/blenkernel/intern/layer.c @@ -252,16 +252,10 @@ static void layer_collection_base_flag_recalculate(LayerCollection *lc, const bo if (is_visible) { base->flag |= BASE_VISIBLED; } - else { - base->flag &= ~BASE_VISIBLED; - } if (is_selectable) { base->flag |= BASE_SELECTABLED; } - else { - base->flag &= ~BASE_SELECTABLED; - } } for (LayerCollection *lcn = lc->layer_collections.first; lcn; lcn = lcn->next) { @@ -274,6 +268,10 @@ static void layer_collection_base_flag_recalculate(LayerCollection *lc, const bo */ void BKE_scene_layer_base_flag_recalculate(SceneLayer *sl) { + for (Base *base = sl->object_bases.first; base; base = base->next) { + base->flag &= ~(BASE_VISIBLED | BASE_SELECTABLED); + } + for (LayerCollection *lc = sl->layer_collections.first; lc; lc = lc->next) { layer_collection_base_flag_recalculate(lc, true, true); } |