diff options
author | Jeroen Bakker <jeroen@blender.org> | 2019-12-03 11:13:17 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2019-12-03 13:28:01 +0300 |
commit | d6fe8cea736957fc8ef8164159d555e1d1b7cfe8 (patch) | |
tree | 0329b202838b98c80fb9819b84294b89df065dd1 | |
parent | c7e64f67ed8e0a0f1f7a4f3fa1bab55210140543 (diff) |
DrawManager: Bounding Box Drawing
Fix for T72136: Bounding boxes were still drawn even with disabled
overlays. Also the outline displayed the original mesh
Reviewed By: fclem
Differential Revision: https://developer.blender.org/D6350
-rw-r--r-- | source/blender/draw/engines/overlay/overlay_engine.c | 4 | ||||
-rw-r--r-- | source/blender/draw/engines/overlay/overlay_outline.c | 6 |
2 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/draw/engines/overlay/overlay_engine.c b/source/blender/draw/engines/overlay/overlay_engine.c index 667172e5bb5..e83a5c04eaf 100644 --- a/source/blender/draw/engines/overlay/overlay_engine.c +++ b/source/blender/draw/engines/overlay/overlay_engine.c @@ -336,7 +336,9 @@ static void OVERLAY_cache_populate(void *vedata, Object *ob) } /* Relationship, object center, bounbox ... */ - OVERLAY_extra_cache_populate(vedata, ob); + if (!pd->hide_overlays) { + OVERLAY_extra_cache_populate(vedata, ob); + } if (dupli) { dupli->base_flag = ob->base_flag; diff --git a/source/blender/draw/engines/overlay/overlay_outline.c b/source/blender/draw/engines/overlay/overlay_outline.c index a0c7f575677..cb5344630c3 100644 --- a/source/blender/draw/engines/overlay/overlay_outline.c +++ b/source/blender/draw/engines/overlay/overlay_outline.c @@ -271,6 +271,12 @@ void OVERLAY_outline_cache_populate(OVERLAY_Data *vedata, const DRWContextState *draw_ctx = DRW_context_state_get(); struct GPUBatch *geom; DRWShadingGroup *shgroup = NULL; + const bool draw_outline = ob->dt > OB_BOUNDBOX; + + /* Early exit: outlines of bounding boxes are not drawn. */ + if (!draw_outline) { + return; + } if (ob->type == OB_LIGHTPROBE) { outline_lightprobe(pd, ob, draw_ctx->view_layer); |