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:
authorJoshua Leung <aligorith@gmail.com>2016-04-18 15:18:29 +0300
committerJoshua Leung <aligorith@gmail.com>2016-04-18 15:18:46 +0300
commit2aafadd4acbd6741f4ba0a98dda7b59ef9eb951d (patch)
tree053af527da3209261c21d4a529822a266134f4ff
parent9f39619ddadef25909b0cd9d9b9934e311d23674 (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.
-rw-r--r--source/blender/editors/gpencil/gpencil_utils.c4
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