[Bf-blender-cvs] [ec4f82f] GPencil_Editing_Stage3: GP Smooth Brush: Affect endpoints by a reduced amount instead of not at all

Joshua Leung noreply at git.blender.org
Tue Jul 7 12:03:10 CEST 2015


Commit: ec4f82f9caaa938f5c45ac3207cad57a76a67c3a
Author: Joshua Leung
Date:   Tue Jul 7 17:52:36 2015 +1200
Branches: GPencil_Editing_Stage3
https://developer.blender.org/rBec4f82f9caaa938f5c45ac3207cad57a76a67c3a

GP Smooth Brush: Affect endpoints by a reduced amount instead of not at all

Endpoints can't be handled normally, as they tend to easily "shrink",
reducing the length of the stroke. However, we still want some smoothing
to take place, as it looks odd without anything happening.

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

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 84fb8ac..0bc23a1 100644
--- a/source/blender/editors/gpencil/gpencil_brush.c
+++ b/source/blender/editors/gpencil/gpencil_brush.c
@@ -211,9 +211,11 @@ static bool gp_brush_smooth_apply(tGP_BrushEditData *gso, bGPDstroke *gps, int i
 		return false;
 	}
 	
-	/* Do not touch the endpoints of the stroke either, to prevent it from shrinking */
+	/* Only affect endpoints by a fraction of the normal strength,
+	 * to prevent the stroke from shrinking too much
+	 */
 	if ((i == 0) || (i == gps->totpoints - 1)) {
-		return false;
+		inf *= 0.1f;
 	}
 	
 	/* Compute smoothed coordinate by taking the ones nearby */




More information about the Bf-blender-cvs mailing list