diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-06-28 17:12:24 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-06-28 17:12:24 +0300 |
commit | aacd15e8a90da6300b8d9e72ed179a8c3622b33a (patch) | |
tree | 3a9011921efa07f4766b94b4bf36cb7ac4294319 /source/blender/draw | |
parent | 8caedc27d982fa269ed064efb0046dacdcbd8e1c (diff) |
Overlay: Make overlay engine rebder on top of paint modes.
This puts the wireframe on top of the weight in weight paint mode,
sculpt mode ...
Wireframe should be colored differently if the object is in paint mode
but it's not there yet.
Diffstat (limited to 'source/blender/draw')
-rw-r--r-- | source/blender/draw/intern/draw_manager.c | 39 |
1 files changed, 28 insertions, 11 deletions
diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c index bbbdcd31d9e..504e53fd206 100644 --- a/source/blender/draw/intern/draw_manager.c +++ b/source/blender/draw/intern/draw_manager.c @@ -1021,6 +1021,27 @@ static void drw_engines_enable_from_object_mode(void) use_drw_engine(&draw_engine_motion_path_type); } +static void drw_engines_enable_from_paint_mode(int mode) +{ + switch (mode) { + case CTX_MODE_SCULPT: + use_drw_engine(&draw_engine_sculpt_type); + break; + case CTX_MODE_PAINT_WEIGHT: + use_drw_engine(&draw_engine_pose_type); + use_drw_engine(&draw_engine_paint_weight_type); + break; + case CTX_MODE_PAINT_VERTEX: + use_drw_engine(&draw_engine_paint_vertex_type); + break; + case CTX_MODE_PAINT_TEXTURE: + use_drw_engine(&draw_engine_paint_texture_type); + break; + default: + break; + } +} + static void drw_engines_enable_from_mode(int mode) { switch (mode) { @@ -1048,21 +1069,14 @@ static void drw_engines_enable_from_mode(int mode) case CTX_MODE_POSE: use_drw_engine(&draw_engine_pose_type); break; - case CTX_MODE_SCULPT: - use_drw_engine(&draw_engine_sculpt_type); + case CTX_MODE_PARTICLE: + use_drw_engine(&draw_engine_particle_type); break; + case CTX_MODE_SCULPT: case CTX_MODE_PAINT_WEIGHT: - use_drw_engine(&draw_engine_pose_type); - use_drw_engine(&draw_engine_paint_weight_type); - break; case CTX_MODE_PAINT_VERTEX: - use_drw_engine(&draw_engine_paint_vertex_type); - break; case CTX_MODE_PAINT_TEXTURE: - use_drw_engine(&draw_engine_paint_texture_type); - break; - case CTX_MODE_PARTICLE: - use_drw_engine(&draw_engine_particle_type); + /* Should have already been enabled */ break; case CTX_MODE_OBJECT: break; @@ -1096,6 +1110,8 @@ static void drw_engines_enable(ViewLayer *view_layer, RenderEngineType *engine_t drw_engines_enable_from_engine(engine_type, drawtype, v3d->shading.flag); if (DRW_state_draw_support()) { + /* Draw paint modes first so that they are drawn below the wireframes. */ + drw_engines_enable_from_paint_mode(mode); drw_engines_enable_from_overlays(v3d->overlay.flag); drw_engines_enable_from_object_mode(); drw_engines_enable_from_mode(mode); @@ -1648,6 +1664,7 @@ void DRW_draw_select_loop( /* Get list of enabled engines */ if (use_obedit) { + drw_engines_enable_from_paint_mode(obedit_mode); drw_engines_enable_from_mode(obedit_mode); } else { |