[Bf-blender-cvs] [71ddcf1a088] master: Paint: Smoother curve preset

Pablo Dobarro noreply at git.blender.org
Fri Nov 22 18:18:18 CET 2019


Commit: 71ddcf1a0883b21f3c37cde75b26514efd967484
Author: Pablo Dobarro
Date:   Fri Nov 22 18:21:03 2019 +0100
Branches: master
https://developer.blender.org/rB71ddcf1a0883b21f3c37cde75b26514efd967484

Paint: Smoother curve preset

This implements a 5th-order equation smoothstep, which produces a flat
surface at the brush center. Some users find that our current grab brush
is too sharp, so now we have both options.
This also improves the behavior of the new clay brushes.

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D6265

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

M	source/blender/blenkernel/intern/brush.c
M	source/blender/makesdna/DNA_brush_types.h
M	source/blender/makesrna/intern/rna_brush.c

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

diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index 8ba1aa20a26..4d496fe758b 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -1576,6 +1576,9 @@ float BKE_brush_curve_strength(const Brush *br, float p, const float len)
     case BRUSH_CURVE_SMOOTH:
       strength = 3.0f * p * p - 2.0f * p * p * p;
       break;
+    case BRUSH_CURVE_SMOOTHER:
+      strength = pow3f(p) * (p * (p * 6.0f - 15.0f) + 10.0f);
+      break;
     case BRUSH_CURVE_ROOT:
       strength = sqrtf(p);
       break;
diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h
index 8f9bc1ddedb..3860ea6b312 100644
--- a/source/blender/makesdna/DNA_brush_types.h
+++ b/source/blender/makesdna/DNA_brush_types.h
@@ -199,6 +199,7 @@ typedef enum eBrushCurvePreset {
   BRUSH_CURVE_POW4 = 6,
   BRUSH_CURVE_INVSQUARE = 7,
   BRUSH_CURVE_CONSTANT = 8,
+  BRUSH_CURVE_SMOOTHER = 9,
 } eBrushCurvePreset;
 
 typedef enum eBrushElasticDeformType {
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c
index cd641c3d372..2d70950ce7b 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -1599,6 +1599,7 @@ static void rna_def_brush(BlenderRNA *brna)
   static const EnumPropertyItem brush_curve_preset_items[] = {
       {BRUSH_CURVE_CUSTOM, "CUSTOM", ICON_RNDCURVE, "Custom", ""},
       {BRUSH_CURVE_SMOOTH, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", ""},
+      {BRUSH_CURVE_SMOOTHER, "SMOOTHER", ICON_SMOOTHCURVE, "Smoother", ""},
       {BRUSH_CURVE_SPHERE, "SPHERE", ICON_SPHERECURVE, "Sphere", ""},
       {BRUSH_CURVE_ROOT, "ROOT", ICON_ROOTCURVE, "Root", ""},
       {BRUSH_CURVE_SHARP, "SHARP", ICON_SHARPCURVE, "Sharp", ""},



More information about the Bf-blender-cvs mailing list