[Bf-blender-cvs] [db065e2] GPencil_Editing_Stage3: GP Sculpt: Allow randomise to offset points to either side of the line

Joshua Leung noreply at git.blender.org
Thu Jul 23 03:20:28 CEST 2015


Commit: db065e2ef80436139511e5bf24e9fc3801db1975
Author: Joshua Leung
Date:   Thu Jul 23 12:50:45 2015 +1200
Branches: GPencil_Editing_Stage3
https://developer.blender.org/rBdb065e2ef80436139511e5bf24e9fc3801db1975

GP Sculpt: Allow randomise to offset points to either side of the line

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

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 f9b556e..e1fe4cc 100644
--- a/source/blender/editors/gpencil/gpencil_brush.c
+++ b/source/blender/editors/gpencil/gpencil_brush.c
@@ -564,7 +564,7 @@ static bool gp_brush_randomise_apply(tGP_BrushEditData *gso, bGPDstroke *gps, in
 	/* Amount of jitter to apply depends on the distance of the point to the cursor,
 	 * as well as the strength of the brush
 	 */
-	const float inf = gp_brush_influence_calc(gso, radius, co);
+	const float inf = gp_brush_influence_calc(gso, radius, co) / 2.0f;
 	
 	//const float dist = (float)len_v2v2_int(gso->mval, co);
 	const float fac = BLI_frand() * inf;
@@ -587,8 +587,13 @@ static bool gp_brush_randomise_apply(tGP_BrushEditData *gso, bGPDstroke *gps, in
 	printf("svec = %f %f, ", svec[0], svec[1]);
 	
 	/* scale the displacement by the random displacement, and apply */
-	normalize_v2(svec);
-	mul_v2_fl(svec, fac);
+	//normalize_v2(svec);
+	if (BLI_frand() > 0.5f) {
+		mul_v2_fl(svec, -fac);
+	}
+	else {
+		mul_v2_fl(svec, fac);
+	}
 	
 	nco[0] = (float)co[0] + svec[0];
 	nco[1] = (float)co[1] + svec[1];




More information about the Bf-blender-cvs mailing list