[Bf-blender-cvs] [b342c293a93] sculpt-mode-features: Grab Brush: Use smooth curve deformation

Pablo Dobarro noreply at git.blender.org
Wed Mar 13 18:11:27 CET 2019


Commit: b342c293a93fcd572f20a62803bedc3323ccb496
Author: Pablo Dobarro
Date:   Wed Mar 13 18:09:37 2019 +0100
Branches: sculpt-mode-features
https://developer.blender.org/rBb342c293a93fcd572f20a62803bedc3323ccb496

Grab Brush: Use smooth curve deformation

For now, this ignores the brush curve. The brush curve does't make sense
in some brushes and in other ones it should be optional (like in the
grab brush). This needs design to integrate with the UI.

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

M	source/blender/editors/sculpt_paint/sculpt.c

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

diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 792defa27fa..927012f6062 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -1293,7 +1293,18 @@ float tex_strength(SculptSession *ss, const Brush *br,
 	}
 
 	/* Falloff curve */
-	avg *= BKE_brush_curve_strength(br, len, cache->radius);
+	float dist_nrm, factor;
+	switch (br->sculpt_tool) {
+		case SCULPT_TOOL_GRAB:
+			dist_nrm = len/cache->radius;
+			factor = 3.0f * dist_nrm * dist_nrm - 2.0f * dist_nrm * dist_nrm * dist_nrm;
+			avg *= (1 - factor);
+			avg *= 0.5f;
+			break;
+		default:
+			avg *= BKE_brush_curve_strength(br, len, cache->radius);
+			break;
+	}
 
 	avg *= frontface(br, cache->view_normal, vno, fno);



More information about the Bf-blender-cvs mailing list