Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Vazquez <blendergit@gmail.com>2019-08-25 21:55:56 +0300
committerAntonio Vazquez <blendergit@gmail.com>2019-08-25 21:56:09 +0300
commitb876fe3f3d1f6f5017cff06f873acc9750b28179 (patch)
treed8c1fec01be89f18cea0815b2fce9665aaffcb49 /source/blender/draw/engines/gpencil/gpencil_draw_utils.c
parentde0fc96dfeb9fca732a9fea2532eeee3c9ded842 (diff)
GPencil: Show edit points in Sculpt only if mask is enabled
If the masks are disabled, the edit points must not visible.
Diffstat (limited to 'source/blender/draw/engines/gpencil/gpencil_draw_utils.c')
-rw-r--r--source/blender/draw/engines/gpencil/gpencil_draw_utils.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
index e043ac9a563..93040afe2c7 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
@@ -938,6 +938,12 @@ static void gpencil_add_editpoints_vertexdata(GpencilBatchCache *cache,
{
const DRWContextState *draw_ctx = DRW_context_state_get();
View3D *v3d = draw_ctx->v3d;
+ ToolSettings *ts = draw_ctx->scene->toolsettings;
+ const bool use_sculpt_mask = (GPENCIL_SCULPT_MODE(gpd) && (ts->gpencil_selectmode_sculpt &
+ (GP_SCULPT_MASK_SELECTMODE_POINT |
+ GP_SCULPT_MASK_SELECTMODE_STROKE |
+ GP_SCULPT_MASK_SELECTMODE_SEGMENT)));
+
MaterialGPencilStyle *gp_style = BKE_material_gpencil_settings_get(ob, gps->mat_nr + 1);
/* alpha factor for edit points/line to make them more subtle */
@@ -949,12 +955,14 @@ static void gpencil_add_editpoints_vertexdata(GpencilBatchCache *cache,
return;
}
const bool is_weight_paint = (gpd) && (gpd->flag & GP_DATA_STROKE_WEIGHTMODE);
+ const bool hide_select = GPENCIL_SCULPT_MODE(gpd) && !use_sculpt_mask;
if (cache->is_dirty) {
if ((obact == ob) && ((v3d->flag2 & V3D_HIDE_OVERLAYS) == 0) &&
(v3d->gp_flag & V3D_GP_SHOW_EDIT_LINES)) {
+
/* line of the original stroke */
- gpencil_get_edlin_geom(&cache->b_edlin, gps, edit_alpha, gpd->flag);
+ gpencil_get_edlin_geom(&cache->b_edlin, gps, edit_alpha, hide_select);
/* add to list of groups */
cache->grp_cache = gpencil_group_cache_add(cache->grp_cache,
@@ -967,6 +975,12 @@ static void gpencil_add_editpoints_vertexdata(GpencilBatchCache *cache,
&cache->grp_size,
&cache->grp_used);
}
+
+ /* In sculpt mode, the point are only visible if masking is enabled. */
+ if (hide_select) {
+ return;
+ }
+
/* edit points */
if ((gps->flag & GP_STROKE_SELECT) || (is_weight_paint)) {
if ((gpl->flag & GP_LAYER_UNLOCK_COLOR) ||