[Bf-blender-cvs] [d9d11e2faf0] blender-v2.82-release: Fix T73327: GPencil strength sculpt brush not working with small brush radius

Antonio Vazquez noreply at git.blender.org
Thu Jan 23 16:55:55 CET 2020


Commit: d9d11e2faf0502eab215f8f13661972f9b459d3a
Author: Antonio Vazquez
Date:   Thu Jan 23 16:55:37 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rBd9d11e2faf0502eab215f8f13661972f9b459d3a

Fix T73327: GPencil strength sculpt brush not working with small brush radius

The problem was related to the smooth of the strength. As the factor was very low and the value was smoothed , the result was almost nothing when the radius was very small. Now the factor is higher and the smooth is done after clamping pressure.

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

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

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

diff --git a/source/blender/editors/gpencil/gpencil_brush.c b/source/blender/editors/gpencil/gpencil_brush.c
index 4948df606ee..91e70e0e089 100644
--- a/source/blender/editors/gpencil/gpencil_brush.c
+++ b/source/blender/editors/gpencil/gpencil_brush.c
@@ -424,7 +424,8 @@ static bool gp_brush_strength_apply(tGP_BrushEditData *gso,
    * - We divide the strength, so that users can set "sane" values.
    *   Otherwise, good default values are in the range of 0.093
    */
-  inf = gp_brush_influence_calc(gso, radius, co) / 20.0f;
+  inf = gp_brush_influence_calc(gso, radius, co) / 2.0f;
+  CLAMP_MIN(inf, 0.01f);
 
   /* apply */
   if (gp_brush_invert_check(gso)) {
@@ -435,12 +436,12 @@ static bool gp_brush_strength_apply(tGP_BrushEditData *gso,
     /* make line more opaque - increase stroke strength */
     pt->strength += inf;
   }
-  /* smooth the strength */
-  BKE_gpencil_smooth_stroke_strength(gps, pt_index, inf);
-
   /* Strength should stay within [0.0, 1.0] */
   CLAMP(pt->strength, 0.0f, 1.0f);
 
+  /* smooth the strength */
+  BKE_gpencil_smooth_stroke_strength(gps, pt_index, inf);
+
   return true;
 }



More information about the Bf-blender-cvs mailing list