[Bf-blender-cvs] [76ebc608af7] master: Fix T77871: GPencil masked points fails with previous point
Antonio Vazquez
noreply at git.blender.org
Mon Jun 15 11:49:13 CEST 2020
Commit: 76ebc608af7a89d2e9919d67ec6b639d47f70c1a
Author: Antonio Vazquez
Date: Mon Jun 15 11:48:56 2020 +0200
Branches: master
https://developer.blender.org/rB76ebc608af7a89d2e9919d67ec6b639d47f70c1a
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.
===================================================================
M source/blender/editors/gpencil/gpencil_sculpt_paint.c
M source/blender/editors/gpencil/gpencil_vertex_paint.c
===================================================================
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);
}
More information about the Bf-blender-cvs
mailing list