diff options
author | Joshua Leung <aligorith@gmail.com> | 2016-04-18 15:18:29 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2016-04-18 15:18:46 +0300 |
commit | 2aafadd4acbd6741f4ba0a98dda7b59ef9eb951d (patch) | |
tree | 053af527da3209261c21d4a529822a266134f4ff /source/blender/editors | |
parent | 9f39619ddadef25909b0cd9d9b9934e311d23674 (diff) |
Fix T48186: Grease Pencil Smooth brush doesn't work properly - "erase" the stroke thickness
As soon as you started trying to smooth a stroke, the thickness of the stroke
would quickly drop right down to near zero, if "affect pressure" was enabled.
This step got accidentally missed when restoring the affect pressure functionality to
the stroke smoothing brush code, following cleanups from the stroke quality patch.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_utils.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c index 64cb0b5bb6a..f54da91af71 100644 --- a/source/blender/editors/gpencil/gpencil_utils.c +++ b/source/blender/editors/gpencil/gpencil_utils.c @@ -569,6 +569,10 @@ bool gp_smooth_stroke(bGPDstroke *gps, int i, float inf, bool affect_pressure) /* add the point itself */ madd_v3_v3fl(sco, &pt->x, average_fac); + if (affect_pressure) { + pressure += pt->pressure * average_fac; + } + /* n-steps before/after current point */ // XXX: review how the endpoints are treated by this algorithm // XXX: falloff measures should also introduce some weighting variations, so that further-out points get less weight |