[Bf-blender-cvs] [518db25122a] greasepencil-object: GPencil: Use Stroke Vertex mode in Tint tool

Antonio Vazquez noreply at git.blender.org
Mon Nov 4 10:52:36 CET 2019


Commit: 518db25122ac77994e6e5cdb9b4414fbe1955466
Author: Antonio Vazquez
Date:   Mon Nov 4 10:52:19 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rB518db25122ac77994e6e5cdb9b4414fbe1955466

GPencil: Use Stroke Vertex mode in Tint tool

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

M	source/blender/blenkernel/BKE_gpencil.h
M	source/blender/editors/gpencil/gpencil_tint.c

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

diff --git a/source/blender/blenkernel/BKE_gpencil.h b/source/blender/blenkernel/BKE_gpencil.h
index fcddecae3e2..03304252aae 100644
--- a/source/blender/blenkernel/BKE_gpencil.h
+++ b/source/blender/blenkernel/BKE_gpencil.h
@@ -75,6 +75,12 @@ struct MDeformVert;
   ((GPENCIL_USE_VERTEX_COLOR(toolsettings) && \
     ((toolsettings->gp_paint->mode == GPPAINT_MODE_FILL) || \
      (toolsettings->gp_paint->mode == GPPAINT_MODE_BOTH))))
+#define GPENCIL_TINT_VERTEX_COLOR_STROKE(toolsettings) \
+  ((toolsettings->gp_paint->mode == GPPAINT_MODE_STROKE) || \
+   (toolsettings->gp_paint->mode == GPPAINT_MODE_BOTH))
+#define GPENCIL_TINT_VERTEX_COLOR_FILL(toolsettings) \
+  ((toolsettings->gp_paint->mode == GPPAINT_MODE_FILL) || \
+   (toolsettings->gp_paint->mode == GPPAINT_MODE_BOTH))
 
 /* ------------ Grease-Pencil API ------------------ */
 
diff --git a/source/blender/editors/gpencil/gpencil_tint.c b/source/blender/editors/gpencil/gpencil_tint.c
index 10cccccbcc8..e77182095a7 100644
--- a/source/blender/editors/gpencil/gpencil_tint.c
+++ b/source/blender/editors/gpencil/gpencil_tint.c
@@ -207,6 +207,8 @@ static bool brush_tint_apply(tGP_BrushTintData *gso,
                              const int radius,
                              const int co[2])
 {
+  ToolSettings *ts = gso->scene->toolsettings;
+
   /* Attenuate factor to get a smoother tinting. */
   float inf = brush_influence_calc(gso, radius, co) / 100.0f;
   Brush *brush = gso->brush;
@@ -224,9 +226,11 @@ static bool brush_tint_apply(tGP_BrushTintData *gso,
 
   CLAMP(alpha, 0.0f, 1.0f);
 
-  /* Apply color to point. */
-  interp_v3_v3v3(pt->mix_color, pt->mix_color, brush->rgb, inf);
-  pt->mix_color[3] = alpha;
+  /* Apply color Stroke to point. */
+  if (GPENCIL_TINT_VERTEX_COLOR_STROKE(ts)) {
+    interp_v3_v3v3(pt->mix_color, pt->mix_color, brush->rgb, inf);
+    pt->mix_color[3] = alpha;
+  }
 
   return true;
 }



More information about the Bf-blender-cvs mailing list