diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-08-20 14:18:41 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-08-20 14:19:17 +0300 |
commit | 31a1c2b7d2ab307475ec08dc4f7b6f8e6a9eebe1 (patch) | |
tree | 8e94be540845cbfad99a1d5014d5a82e4ef552b1 /source | |
parent | 70e10d6207c0375d514eb9c5403e3593fdf4ebbe (diff) |
Object Mode: Add back support for the object "Maximum draw type" option
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/draw/intern/draw_manager.c | 3 | ||||
-rw-r--r-- | source/blender/draw/modes/object_mode.c | 5 | ||||
-rw-r--r-- | source/blender/draw/modes/overlay_mode.c | 9 |
3 files changed, 12 insertions, 5 deletions
diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c index 28703f9014c..70685ededae 100644 --- a/source/blender/draw/intern/draw_manager.c +++ b/source/blender/draw/intern/draw_manager.c @@ -152,6 +152,9 @@ bool DRW_object_is_renderable(Object *ob) { BLI_assert(BKE_object_is_visible(ob, OB_VISIBILITY_CHECK_UNKNOWN_RENDER_MODE)); + if (ob->dt < OB_SOLID) + return false; + if (ob->type == OB_MESH) { if ((ob == DST.draw_ctx.object_edit) || BKE_object_is_in_editmode(ob)) { View3D *v3d = DST.draw_ctx.v3d; diff --git a/source/blender/draw/modes/object_mode.c b/source/blender/draw/modes/object_mode.c index 637256f03fd..ed0bb346b13 100644 --- a/source/blender/draw/modes/object_mode.c +++ b/source/blender/draw/modes/object_mode.c @@ -2521,7 +2521,8 @@ static void OBJECT_cache_populate(void *vedata, Object *ob) return; } - const bool do_outlines = (draw_ctx->v3d->flag & V3D_SELECT_OUTLINE) && ((ob->base_flag & BASE_SELECTED) != 0); + const bool do_outlines = (draw_ctx->v3d->flag & V3D_SELECT_OUTLINE) && ((ob->base_flag & BASE_SELECTED) != 0) && + (DRW_object_is_renderable(ob) || (ob->dt == OB_WIRE)); const bool show_relations = ((draw_ctx->v3d->flag & V3D_HIDE_HELPLINES) == 0); const bool hide_object_extra = (v3d->overlay.flag & V3D_OVERLAY_HIDE_OBJECT_XTRAS) != 0; @@ -2711,7 +2712,7 @@ static void OBJECT_cache_populate(void *vedata, Object *ob) DRW_shgroup_texture_space(sgl, ob, theme_id); } - if (ob->dtx & OB_DRAWBOUNDOX) { + if (ob->dtx & OB_DRAWBOUNDOX || ob->dt == OB_BOUNDBOX) { DRW_shgroup_bounds(sgl, ob, theme_id); } diff --git a/source/blender/draw/modes/overlay_mode.c b/source/blender/draw/modes/overlay_mode.c index 9b6b7f6922d..6aa3a78672e 100644 --- a/source/blender/draw/modes/overlay_mode.c +++ b/source/blender/draw/modes/overlay_mode.c @@ -182,17 +182,20 @@ static void overlay_cache_populate(void *vedata, Object *ob) if (!stl->g_data->show_overlays) return; - if (!DRW_object_is_renderable(ob)) + if (!DRW_object_is_renderable(ob) && (ob->dt != OB_WIRE)) return; - if (stl->g_data->overlay.flag & V3D_OVERLAY_FACE_ORIENTATION) { + if (DRW_object_is_renderable(ob) && stl->g_data->overlay.flag & V3D_OVERLAY_FACE_ORIENTATION) { struct GPUBatch *geom = DRW_cache_object_surface_get(ob); if (geom) { DRW_shgroup_call_add(pd->face_orientation_shgrp, geom, ob->obmat); } } - if ((stl->g_data->overlay.flag & V3D_OVERLAY_WIREFRAMES) || (ob->dtx & OB_DRAWWIRE)) { + if ((stl->g_data->overlay.flag & V3D_OVERLAY_WIREFRAMES) || + (ob->dtx & OB_DRAWWIRE) || + (ob->dt == OB_WIRE)) + { /* Don't do that in edit mode. */ if ((ob != draw_ctx->object_edit) && !BKE_object_is_in_editmode(ob)) { int tri_count; |