diff options
author | Jeroen Bakker <jbakker> | 2022-07-08 13:07:08 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2022-07-08 13:08:31 +0300 |
commit | a8f7d41d3898a8d3ae8afb4f95ea9f4f44db2a69 (patch) | |
tree | b965e51a0b44c3a301fbf98a22da953031616f1c /source/blender/draw/engines/basic/basic_engine.c | |
parent | 2c4dfe3453f09a0877a9c825347df1aef128bea8 (diff) |
Draw: Curve outline drawing in object mode.
This patch adds (selected/active) outline around a curve object in object mode.
{F13270680}
In the past the draw bounds option was enabled for any curve objects. With this
patch it isn't needed and will be disabled.
In the future the curve outline could also be enabled to improve GPU selection.
Reviewed By: dfelinto, HooglyBoogly, fclem
Maniphest Tasks: T95933
Differential Revision: https://developer.blender.org/D15308
Diffstat (limited to 'source/blender/draw/engines/basic/basic_engine.c')
-rw-r--r-- | source/blender/draw/engines/basic/basic_engine.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/draw/engines/basic/basic_engine.c b/source/blender/draw/engines/basic/basic_engine.c index 04a3c27959d..975d9e299bf 100644 --- a/source/blender/draw/engines/basic/basic_engine.c +++ b/source/blender/draw/engines/basic/basic_engine.c @@ -53,6 +53,7 @@ typedef struct BASIC_PrivateData { DRWShadingGroup *depth_shgrp[2]; DRWShadingGroup *depth_shgrp_cull[2]; DRWShadingGroup *depth_hair_shgrp[2]; + DRWShadingGroup *depth_curves_shgrp[2]; DRWShadingGroup *depth_pointcloud_shgrp[2]; bool use_material_slot_selection; } BASIC_PrivateData; /* Transient data */ @@ -99,6 +100,9 @@ static void basic_cache_init(void *vedata) stl->g_data->depth_hair_shgrp[i] = grp = DRW_shgroup_create( BASIC_shaders_depth_sh_get(draw_ctx->sh_cfg), psl->depth_pass[i]); + stl->g_data->depth_curves_shgrp[i] = grp = DRW_shgroup_create( + BASIC_shaders_curves_depth_sh_get(draw_ctx->sh_cfg), psl->depth_pass[i]); + sh = DRW_state_is_select() ? BASIC_shaders_depth_conservative_sh_get(draw_ctx->sh_cfg) : BASIC_shaders_depth_sh_get(draw_ctx->sh_cfg); state |= DRW_STATE_CULL_BACK; @@ -156,8 +160,12 @@ static void basic_cache_populate(void *vedata, Object *ob) basic_cache_populate_particles(vedata, ob); } - /* Make flat object selectable in ortho view if wireframe is enabled. */ const bool do_in_front = (ob->dtx & OB_DRAW_IN_FRONT) != 0; + if (ob->type == OB_CURVES) { + DRW_shgroup_curves_create_sub(ob, stl->g_data->depth_curves_shgrp[do_in_front], NULL); + } + + /* Make flat object selectable in ortho view if wireframe is enabled. */ if ((draw_ctx->v3d->overlay.flag & V3D_OVERLAY_WIREFRAMES) || (draw_ctx->v3d->shading.type == OB_WIRE) || (ob->dtx & OB_DRAWWIRE) || (ob->dt == OB_WIRE)) { int flat_axis = 0; |