[Bf-blender-cvs] [fcdaeba7782] blender-v2.83-release: Fix T94799: GPencil Strokes drawn at 0.0 Strength still visible

Antonio Vazquez noreply at git.blender.org
Mon Jan 17 15:56:42 CET 2022


Commit: fcdaeba7782073b4b1166ed912ad7983cd89b36c
Author: Antonio Vazquez
Date:   Tue Jan 11 22:45:21 2022 +0100
Branches: blender-v2.83-release
https://developer.blender.org/rBfcdaeba7782073b4b1166ed912ad7983cd89b36c

Fix T94799: GPencil Strokes drawn at 0.0 Strength still visible

There was a clamp with a value greater than 0.

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

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

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

diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 139e52254f4..9c8be88ea00 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -765,7 +765,7 @@ static short gp_stroke_addpoint(tGPsdata *p, const float mval[2], float pressure
     /* color strength */
     if (brush_settings->flag & GP_BRUSH_USE_STENGTH_PRESSURE) {
       pt->strength *= BKE_curvemapping_evaluateF(brush_settings->curve_strength, 0, pressure);
-      CLAMP(pt->strength, GPENCIL_STRENGTH_MIN, 1.0f);
+      CLAMP(pt->strength, MIN2(GPENCIL_STRENGTH_MIN, brush_settings->draw_strength), 1.0f);
     }
 
     if (brush_settings->flag & GP_BRUSH_GROUP_RANDOM) {
@@ -865,6 +865,7 @@ static void gp_stroke_newfrombuffer(tGPsdata *p)
   tGPspoint *ptc;
   MDeformVert *dvert = NULL;
   Brush *brush = p->brush;
+  BrushGpencilSettings *brush_settings = brush->gpencil_settings;
   ToolSettings *ts = p->scene->toolsettings;
   Depsgraph *depsgraph = p->depsgraph;
   Object *obact = (Object *)p->ownerPtr.data;
@@ -958,7 +959,7 @@ static void gp_stroke_newfrombuffer(tGPsdata *p)
       /* copy pressure and time */
       pt->pressure = ptc->pressure;
       pt->strength = ptc->strength;
-      CLAMP(pt->strength, GPENCIL_STRENGTH_MIN, 1.0f);
+      CLAMP(pt->strength, MIN2(GPENCIL_STRENGTH_MIN, brush_settings->draw_strength), 1.0f);
       pt->time = ptc->time;
       /* Apply the vertex color to point. */
       ED_gpencil_point_vertex_color_set(ts, brush, pt);
@@ -991,7 +992,7 @@ static void gp_stroke_newfrombuffer(tGPsdata *p)
       /* copy pressure and time */
       pt->pressure = ptc->pressure;
       pt->strength = ptc->strength;
-      CLAMP(pt->strength, GPENCIL_STRENGTH_MIN, 1.0f);
+      CLAMP(pt->strength, MIN2(GPENCIL_STRENGTH_MIN, brush_settings->draw_strength), 1.0f);
       pt->time = ptc->time;
       /* Apply the vertex color to point. */
       ED_gpencil_point_vertex_color_set(ts, brush, pt);
@@ -1112,7 +1113,7 @@ static void gp_stroke_newfrombuffer(tGPsdata *p)
       /* copy pressure and time */
       pt->pressure = ptc->pressure;
       pt->strength = ptc->strength;
-      CLAMP(pt->strength, GPENCIL_STRENGTH_MIN, 1.0f);
+      CLAMP(pt->strength, MIN2(GPENCIL_STRENGTH_MIN, brush_settings->draw_strength), 1.0f);
       pt->time = ptc->time;
       pt->uv_fac = ptc->uv_fac;
       pt->uv_rot = ptc->uv_rot;



More information about the Bf-blender-cvs mailing list