[Bf-blender-cvs] [5fc3ee0b924] greasepencil-object: GPencil: Use Mask in Vertex Paint operator

Antonio Vazquez noreply at git.blender.org
Thu Nov 7 23:36:39 CET 2019


Commit: 5fc3ee0b924e19e838d3a4c76609e3bec029a5c8
Author: Antonio Vazquez
Date:   Thu Nov 7 23:13:13 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rB5fc3ee0b924e19e838d3a4c76609e3bec029a5c8

GPencil: Use Mask in Vertex Paint operator

===================================================================

M	source/blender/editors/gpencil/gpencil_tint.c

===================================================================

diff --git a/source/blender/editors/gpencil/gpencil_tint.c b/source/blender/editors/gpencil/gpencil_tint.c
index 08676f22e36..e6751e8e299 100644
--- a/source/blender/editors/gpencil/gpencil_tint.c
+++ b/source/blender/editors/gpencil/gpencil_tint.c
@@ -76,6 +76,8 @@ typedef struct tGP_BrushTintData {
   Brush *brush;
   eGP_Sculpt_Flag flag;
 
+  eGP_Vertex_SelectMaskFlag mask;
+
   /* Space Conversion Data */
   GP_SpaceConversion gsc;
 
@@ -324,6 +326,9 @@ static bool gptint_brush_init(bContext *C, wmOperator *op)
   gso->sa = CTX_wm_area(C);
   gso->ar = CTX_wm_region(C);
 
+  /* save mask */
+  gso->mask = ts->gpencil_selectmode_vertex;
+
   /* multiframe settings */
   gso->is_multiframe = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gso->gpd);
   gso->use_multiframe_falloff = (ts->gp_sculpt.flag & GP_SCULPT_SETT_FLAG_FRAME_FALLOFF) != 0;
@@ -482,6 +487,15 @@ static bool gptint_brush_do_stroke(tGP_BrushTintData *gso,
       pt1 = gps->points + i;
       pt2 = gps->points + i + 1;
 
+      /* Skip if neither one is selected
+       * (and we are only allowed to edit/consider selected points) */
+      if (GPENCIL_ANY_VERTEX_MASK(gso->mask)) {
+        if (!(pt1->flag & GP_SPOINT_SELECT) && !(pt2->flag & GP_SPOINT_SELECT)) {
+          include_last = false;
+          continue;
+        }
+      }
+
       bGPDspoint npt;
       gp_point_to_parent_space(pt1, diff_mat, &npt);
       gp_point_to_xy(gsc, gps, &npt, &pc1[0], &pc1[1]);



More information about the Bf-blender-cvs mailing list