diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-05-15 00:36:56 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-06-20 13:35:25 +0300 |
commit | 0619f960c2999873ed2e9a24a1f5d77eac03e64d (patch) | |
tree | e06cbd56d4fcbc4746ce51a28b7e9d82795ff552 /source/blender/blenkernel/intern/layer.c | |
parent | c17ba4a9032246cc674cdc03a2f39b91b32fecd9 (diff) |
Objects: restore H key per object hiding.
H hides selected objects, Shift+H hides unselected objects, and Alt+H
reveals hidden objects.
This hiding state is distinct from restrict viewport and render, and
meant for temporarily hiding objects without affecting more persistent
collection hiding.
Object hiding is per view-layer, same as selection. It affects the
viewport and any preview renders in there, but not final renders.
In the outliner, different icons are now used for temporary hiding, and
restrict viewport and render. Hidden objects are greyed out.
Remaining design issues:
* For lamps we probably still want to keep their effect on the scene,
currently they are fully disabled by hiding. Arguably mesh lights or
even objects being reflected or casting shadows are not that different
but perhaps the special lamp exception from local view should remain.
* We need a feature still to disabled this hiding for specific viewports,
for render or animation preview where you want to see the entire scene
while working in another view.
* We need a new icon for restrict viewport, for now it uses a grid similar
to the 2.4 icon.
* Hiding objects does not preserve selection state as it did in 2.7,
it's probably convenient to support this again?
Diffstat (limited to 'source/blender/blenkernel/intern/layer.c')
-rw-r--r-- | source/blender/blenkernel/intern/layer.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/layer.c b/source/blender/blenkernel/intern/layer.c index 3ed16b57dcc..090be7e0fe5 100644 --- a/source/blender/blenkernel/intern/layer.c +++ b/source/blender/blenkernel/intern/layer.c @@ -608,6 +608,8 @@ static void layer_collection_sync( lc->flag = parent_exclude; } + lc->runtime_flag = 0; + /* Collection restrict is inherited. */ int child_restrict = parent_restrict; if (!(collection->flag & COLLECTION_IS_MASTER)) { @@ -655,6 +657,17 @@ static void layer_collection_sync( if ((child_restrict & COLLECTION_RESTRICT_RENDER) == 0) { base->flag |= BASE_VISIBLE_RENDER; } + + /* Update runtime flags used for faster display. */ + if (base->flag & BASE_HIDE) { + view_layer->runtime_flag |= VIEW_LAYER_HAS_HIDE; + } + else if (base->flag & BASE_VISIBLED) { + lc->runtime_flag |= LAYER_COLLECTION_HAS_VISIBLE_OBJECTS; + if (base->flag & BASE_SELECTED) { + lc->runtime_flag |= LAYER_COLLECTION_HAS_SELECTED_OBJECTS; + } + } } } @@ -688,6 +701,8 @@ void BKE_layer_collection_sync(const Scene *scene, ViewLayer *view_layer) base->flag &= ~(BASE_VISIBLED | BASE_SELECTABLED | BASE_VISIBLE_VIEWPORT | BASE_VISIBLE_RENDER); } + view_layer->runtime_flag = 0; + /* Generate new layer connections and object bases when collections changed. */ CollectionChild child = {NULL, NULL, scene->master_collection}; const ListBase collections = {&child, &child}; @@ -1229,7 +1244,8 @@ void BKE_view_layer_bases_in_mode_iterator_end(BLI_Iterator *UNUSED(iter)) static bool base_is_visible(Base *base, eEvaluationMode mode) { if (mode == DAG_EVAL_VIEWPORT) { - return ((base->flag & BASE_VISIBLE_VIEWPORT) != 0); + return ((base->flag & BASE_VISIBLE_VIEWPORT) != 0) && + ((base->flag & BASE_HIDE) == 0); } else { return ((base->flag & BASE_VISIBLE_RENDER) != 0); |