diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2019-10-04 01:22:36 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2019-10-09 01:16:05 +0300 |
commit | 0812949bbc3d7acfd1f20a47087ff973110aa177 (patch) | |
tree | 0ec8a52ea73790d85f4b14993de3c252e9fa6de5 /source/blender/draw/intern/draw_manager.c | |
parent | 6d3c34fe9d1eabc7765275ff68600734be0e3acb (diff) |
Local Collections: Allow users to show hidden collections
Users now can turn on in a viewport collections that are temporarily
hidden (eye) in the view layer.
Design task: T61327
As for the implementation, I had to decouple the visibility in the
depsgraph from the visibility in the view layer.
Also there is a "bug" that in a way was there before which is some
operators (e.g., writing a text inside of a text object, tab into edit
mode) run regardless of the visibility of the active object. The bug was
present already (with object type visibility restriction) in 2.80 so if
we decide to tackle it, can be done separately (I have a patch for it
though P1132).
Reviewed by: brecht (thank you)
Differential Revision: D5992
Diffstat (limited to 'source/blender/draw/intern/draw_manager.c')
-rw-r--r-- | source/blender/draw/intern/draw_manager.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c index 66cf921d47d..6366ed0bb6f 100644 --- a/source/blender/draw/intern/draw_manager.c +++ b/source/blender/draw/intern/draw_manager.c @@ -164,7 +164,7 @@ struct DRWTextStore *DRW_text_cache_ensure(void) bool DRW_object_is_renderable(const Object *ob) { - BLI_assert((ob->base_flag & BASE_VISIBLE) != 0); + BLI_assert((ob->base_flag & BASE_VISIBLE_DEPSGRAPH) != 0); if (ob->type == OB_MESH) { if ((ob == DST.draw_ctx.object_edit) || BKE_object_is_in_editmode(ob)) { @@ -1586,6 +1586,11 @@ static bool is_object_visible_in_viewport(View3D *v3d, Object *ob) return false; } + /* If not using local view or local collection the object may still be in a hidden collection. */ + if (((v3d->localvd) == NULL) && ((v3d->flag & V3D_LOCAL_COLLECTIONS) == 0)) { + return (ob->base_flag & BASE_VISIBLE_VIEWLAYER) != 0; + } + return true; } |