[Bf-blender-cvs] [c3fa124d463] greasepencil-object: Make less sensible strength brush and smooth
Antonio Vazquez
noreply at git.blender.org
Sat Mar 24 13:09:57 CET 2018
Commit: c3fa124d46319c60a33bcc0154ee8ac41e592d9d
Author: Antonio Vazquez
Date: Sat Mar 24 13:09:46 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rBc3fa124d46319c60a33bcc0154ee8ac41e592d9d
Make less sensible strength brush and smooth
Now the factor to apply is less sensible and after apply the strength a smooth operation is done with surrounding points.
Before the change in the opacity changed too much with small input.
===================================================================
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 44df6770cda..c175d4f6467 100644
--- a/source/blender/editors/gpencil/gpencil_brush.c
+++ b/source/blender/editors/gpencil/gpencil_brush.c
@@ -359,13 +359,12 @@ static bool gp_brush_strength_apply(
float inf;
/* Compute strength of effect
- * - We divide the strength by 10, so that users can set "sane" values.
+ * - 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) / 10.0f;
+ inf = gp_brush_influence_calc(gso, radius, co) / 20.0f;
/* apply */
- // XXX: this is much too strong, and it should probably do some smoothing with the surrounding stuff
if (gp_brush_invert_check(gso)) {
/* make line more transparent - reduce alpha factor */
pt->strength -= inf;
@@ -374,6 +373,8 @@ static bool gp_brush_strength_apply(
/* make line more opaque - increase stroke strength */
pt->strength += inf;
}
+ /* smooth the strength */
+ BKE_gp_smooth_stroke_strength(gps, pt_index, inf);
/* Strength should stay within [0.0, 1.0] */
CLAMP(pt->strength, 0.0f, 1.0f);
More information about the Bf-blender-cvs
mailing list