[Bf-blender-cvs] [32aff30] GPencil_Editing_Stage3: GP Sculpt: Pinch brush can now be inverted using Ctrl (i.e. "Inflate")

Joshua Leung noreply at git.blender.org
Tue Jul 14 17:09:12 CEST 2015


Commit: 32aff3021f3e79ddd61a617bbec76892da7b3cab
Author: Joshua Leung
Date:   Wed Jul 15 02:51:34 2015 +1200
Branches: GPencil_Editing_Stage3
https://developer.blender.org/rB32aff3021f3e79ddd61a617bbec76892da7b3cab

GP Sculpt: Pinch brush can now be inverted using Ctrl (i.e. "Inflate")

Just like with the mesh sculpting tools, holding Ctrl can now be used to
apply the inverse transform when using the pinch brush. So, instead of
drawing the points towards the brush, Inflate will push them away.

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

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 354ab82..5f6f4e8 100644
--- a/source/blender/editors/gpencil/gpencil_brush.c
+++ b/source/blender/editors/gpencil/gpencil_brush.c
@@ -516,7 +516,6 @@ static bool gp_brush_pinch_apply(tGP_BrushEditData *gso, bGPDstroke *gps, int i,
 {
 	bGPDspoint *pt = gps->points + i;
 	float inf = gp_brush_influence_calc(gso, radius, co);
-	
 	float vec[3];
 	float fac;
 	
@@ -524,9 +523,18 @@ static bool gp_brush_pinch_apply(tGP_BrushEditData *gso, bGPDstroke *gps, int i,
 	sub_v3_v3v3(vec, &pt->x, gso->dvec);
 	
 	/* 2) Shrink the distance by pulling the point towards the midpoint
-	 *    (0.0 = at midpoint, 1 = at edge of brush region) 
+	 *    (0.0 = at midpoint, 1 = at edge of brush region)
+	 *                         OR
+	 *    Increase the distance (if inverting the brush action!)
 	 */
-	fac = 1.0f - (inf * inf); /* squared to temper the effect... */
+	if (gp_brush_invert_check(gso)) {
+		/* Inflate (inverse) */
+		fac = 1.0f + (inf * inf); /* squared to temper the effect... */
+	}
+	else {
+		/* Shrink (default) */
+		fac = 1.0f - (inf * inf); /* squared to temper the effect... */
+	}
 	mul_v3_fl(vec, fac);
 	
 	/* 3) Translate back to original space, with the shrinkage applied */




More information about the Bf-blender-cvs mailing list