diff options
Diffstat (limited to 'source/blender/draw/modes/overlay_mode.c')
-rw-r--r-- | source/blender/draw/modes/overlay_mode.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/source/blender/draw/modes/overlay_mode.c b/source/blender/draw/modes/overlay_mode.c index 667f2c9e70a..3c5cb7cb5aa 100644 --- a/source/blender/draw/modes/overlay_mode.c +++ b/source/blender/draw/modes/overlay_mode.c @@ -26,8 +26,9 @@ #include "BIF_glutil.h" #include "BKE_editmesh.h" -#include "BKE_object.h" #include "BKE_global.h" +#include "BKE_object.h" +#include "BKE_paint.h" #include "BLI_hash.h" @@ -391,10 +392,10 @@ static void overlay_cache_populate(void *vedata, Object *ob) if ((!pd->show_overlays) || (((ob != draw_ctx->object_edit) && !is_edit_mode) || has_edit_mesh_cage) || ob->type != OB_MESH) { - const bool is_sculpt_mode = DRW_object_use_pbvh_drawing(ob); + const bool use_sculpt_pbvh = BKE_sculptsession_use_pbvh_draw(ob, draw_ctx->v3d); const bool all_wires = (ob->dtx & OB_DRAW_ALL_EDGES); const bool is_wire = (ob->dt < OB_SOLID); - const bool use_coloring = (pd->show_overlays && !is_edit_mode && !is_sculpt_mode && + const bool use_coloring = (pd->show_overlays && !is_edit_mode && !use_sculpt_pbvh && !has_edit_mesh_cage); const int stencil_mask = (ob->dtx & OB_DRAWXRAY) ? 0x00 : 0xFF; float *rim_col, *wire_col; @@ -405,11 +406,11 @@ static void overlay_cache_populate(void *vedata, Object *ob) struct GPUBatch *geom; geom = DRW_cache_object_face_wireframe_get(ob); - if (geom || is_sculpt_mode) { + if (geom || use_sculpt_pbvh) { shgrp = DRW_shgroup_create_sub(pd->face_wires_shgrp); float wire_step_param = 10.0f; - if (!is_sculpt_mode) { + if (!use_sculpt_pbvh) { wire_step_param = (all_wires) ? 1.0f : pd->wire_step_param; } DRW_shgroup_uniform_float_copy(shgrp, "wireStepParam", wire_step_param); @@ -420,7 +421,7 @@ static void overlay_cache_populate(void *vedata, Object *ob) DRW_shgroup_uniform_vec3(shgrp, "rimColor", rim_col, 1); } - if (is_sculpt_mode) { + if (use_sculpt_pbvh) { DRW_shgroup_call_sculpt(shgrp, ob, true, false, false); } else { |