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-29 11:35:22 +0300
committerAntonio Vazquez <blendergit@gmail.com>2019-08-29 11:44:24 +0300
commit6b33bd1067dc34711e0e076070cfaeaf0e3259a5 (patch)
tree47a3b976ae629114d541271051afe356a650e404 /source/blender/draw
parent6b5e2f61b991633611fc6df12e0a99bc3f49c62b (diff)
GPencil: For Stroke select don't display points
Now, when it's selected the stroke select mode, the points are not displayed and the stroke is fully selected automatically extending the selection. Differential Revision: https://developer.blender.org/D5622
Diffstat (limited to 'source/blender/draw')
-rw-r--r--source/blender/draw/engines/gpencil/gpencil_draw_utils.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
index f4b390fb4a4..bef72b9a054 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
@@ -944,6 +944,11 @@ static void gpencil_add_editpoints_vertexdata(GpencilBatchCache *cache,
GP_SCULPT_MASK_SELECTMODE_STROKE |
GP_SCULPT_MASK_SELECTMODE_SEGMENT)));
+ const bool show_sculpt_points = (GPENCIL_SCULPT_MODE(gpd) &&
+ (ts->gpencil_selectmode_sculpt &
+ (GP_SCULPT_MASK_SELECTMODE_POINT |
+ 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 */
@@ -955,8 +960,19 @@ static void gpencil_add_editpoints_vertexdata(GpencilBatchCache *cache,
return;
}
const bool is_weight_paint = (gpd) && (gpd->flag & GP_DATA_STROKE_WEIGHTMODE);
+
+ /* If Sculpt mode and the mask is disabled, the select must be hidden. */
const bool hide_select = GPENCIL_SCULPT_MODE(gpd) && !use_sculpt_mask;
+ /* Show Edit points if:
+ * Edit mode: Not in Stroke selection mode
+ * Sculpt mode: Not in Stroke mask mode and any other mask mode enabled
+ * Weight mode: Always
+ */
+ const bool show_points = (show_sculpt_points) || (is_weight_paint) ||
+ (GPENCIL_EDIT_MODE(gpd) &&
+ ((ts->gpencil_selectmode_edit & GP_SELECTMODE_STROKE) == 0));
+
if (cache->is_dirty) {
if ((obact == ob) && ((v3d->flag2 & V3D_HIDE_OVERLAYS) == 0) &&
(v3d->gp_flag & V3D_GP_SHOW_EDIT_LINES)) {
@@ -976,8 +992,8 @@ static void gpencil_add_editpoints_vertexdata(GpencilBatchCache *cache,
&cache->grp_used);
}
- /* In sculpt mode, the point are only visible if masking is enabled. */
- if (hide_select) {
+ /* If the points are hidden return. */
+ if ((!show_points) || (hide_select)) {
return;
}