Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Vazquez <blendergit@gmail.com>2020-03-10 18:45:31 +0300
committerAntonio Vazquez <blendergit@gmail.com>2020-03-10 18:45:51 +0300
commitbe20bf2fc0704fa5894dbce5e3dbb0b7784eb3eb (patch)
tree91c639aad0b7941ff4606a0611de2c5bfe180c51 /source/blender/editors/gpencil/gpencil_sculpt_paint.c
parent1619a5d8e9bb2a897f4fbbfb4593aecee88d7b71 (diff)
Fix T74617: Gpencil Sculpt Strength brush gets wonky results
Changed how the strength is calculñated and reduce the factor to get a smoother result.
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_sculpt_paint.c')
-rw-r--r--source/blender/editors/gpencil/gpencil_sculpt_paint.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/source/blender/editors/gpencil/gpencil_sculpt_paint.c b/source/blender/editors/gpencil/gpencil_sculpt_paint.c
index 5cf4681c755..adc009efd16 100644
--- a/source/blender/editors/gpencil/gpencil_sculpt_paint.c
+++ b/source/blender/editors/gpencil/gpencil_sculpt_paint.c
@@ -405,27 +405,15 @@ static bool gp_brush_strength_apply(tGP_BrushEditData *gso,
bGPDspoint *pt = gps->points + pt_index;
float inf;
- /* Compute strength of effect
- * - 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) / 2.0f;
- CLAMP_MIN(inf, 0.01f);
+ /* Compute strength of effect */
+ inf = gp_brush_influence_calc(gso, radius, co) * 0.125f;
- /* apply */
+ /* Invert effect. */
if (gp_brush_invert_check(gso)) {
- /* make line more transparent - reduce alpha factor */
- pt->strength -= inf;
- }
- else {
- /* make line more opaque - increase stroke strength */
- pt->strength += inf;
+ inf *= -1.0f;
}
- /* Strength should stay within [0.0, 1.0] */
- CLAMP(pt->strength, 0.0f, 1.0f);
- /* smooth the strength */
- BKE_gpencil_stroke_smooth_strength(gps, pt_index, inf);
+ pt->strength = clamp_f(pt->strength + inf, 0.0f, 1.0f);
return true;
}