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>2020-06-15 12:48:56 +0300
committerAntonio Vazquez <blendergit@gmail.com>2020-06-15 12:49:08 +0300
commit76ebc608af7a89d2e9919d67ec6b639d47f70c1a (patch)
treea35a0216d06eb8bab79e4b2ed0e50a12fd44df20 /source/blender/editors/gpencil
parent0c384362272637a3e55b480ac03527a1d1df7a90 (diff)
Fix T77871: GPencil masked points fails with previous point
If selected a point for masking, the previous point that is part of the same segment was included. This bug was in Sculpt and Vertex paint modes because the code was very similar.
Diffstat (limited to 'source/blender/editors/gpencil')
-rw-r--r--source/blender/editors/gpencil/gpencil_sculpt_paint.c5
-rw-r--r--source/blender/editors/gpencil/gpencil_vertex_paint.c7
2 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/editors/gpencil/gpencil_sculpt_paint.c b/source/blender/editors/gpencil/gpencil_sculpt_paint.c
index f7f3b128351..6bd945160a6 100644
--- a/source/blender/editors/gpencil/gpencil_sculpt_paint.c
+++ b/source/blender/editors/gpencil/gpencil_sculpt_paint.c
@@ -1506,6 +1506,11 @@ static bool gpsculpt_brush_do_stroke(tGP_BrushEditData *gso,
continue;
}
pt_active = (pt->runtime.pt_orig) ? pt->runtime.pt_orig : pt;
+ /* If masked and the point is not selected, skip it. */
+ if ((GPENCIL_ANY_SCULPT_MASK(gso->mask)) &&
+ ((pt_active->flag & GP_SPOINT_SELECT) == 0)) {
+ continue;
+ }
index = (pt->runtime.pt_orig) ? pt->runtime.idx_orig : i;
if ((pt_active != NULL) && (index < gps_active->totpoints)) {
rot_eval = gpsculpt_rotation_eval_get(gso, gps, pt, i);
diff --git a/source/blender/editors/gpencil/gpencil_vertex_paint.c b/source/blender/editors/gpencil/gpencil_vertex_paint.c
index 581a5d977c2..fe3f0871fdc 100644
--- a/source/blender/editors/gpencil/gpencil_vertex_paint.c
+++ b/source/blender/editors/gpencil/gpencil_vertex_paint.c
@@ -880,7 +880,7 @@ static void gp_vertexpaint_select_stroke(tGP_BrushVertexpaintData *gso,
/* Skip if neither one is selected
* (and we are only allowed to edit/consider selected points) */
- if ((GPENCIL_ANY_VERTEX_MASK(gso->mask)) && (GPENCIL_VERTEX_MODE(gso->gpd))) {
+ if (GPENCIL_ANY_VERTEX_MASK(gso->mask)) {
if (!(pt1->flag & GP_SPOINT_SELECT) && !(pt2->flag & GP_SPOINT_SELECT)) {
include_last = false;
continue;
@@ -908,6 +908,11 @@ static void gp_vertexpaint_select_stroke(tGP_BrushVertexpaintData *gso,
pt_active = (pt->runtime.pt_orig) ? pt->runtime.pt_orig : pt;
index = (pt->runtime.pt_orig) ? pt->runtime.idx_orig : i;
if (pt_active != NULL) {
+ /* If masked and the point is not selected, skip it. */
+ if ((GPENCIL_ANY_VERTEX_MASK(gso->mask)) &&
+ ((pt_active->flag & GP_SPOINT_SELECT) == 0)) {
+ continue;
+ }
hit = true;
gp_save_selected_point(gso, gps_active, index, pc1);
}