[Bf-blender-cvs] [2aafadd] master: Fix T48186: Grease Pencil Smooth brush doesn't work properly - "erase" the stroke thickness

Joshua Leung noreply at git.blender.org
Mon Apr 18 14:20:09 CEST 2016


Commit: 2aafadd4acbd6741f4ba0a98dda7b59ef9eb951d
Author: Joshua Leung
Date:   Tue Apr 19 00:18:29 2016 +1200
Branches: master
https://developer.blender.org/rB2aafadd4acbd6741f4ba0a98dda7b59ef9eb951d

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.

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

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

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

diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c
index 64cb0b5..f54da91 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




More information about the Bf-blender-cvs mailing list