[Bf-blender-cvs] [0940b357552] temp-sculpt-brush-channel: temp-sculpt-brush-channel: Fix broken BrushMapping custom curves

Joseph Eagar noreply at git.blender.org
Thu Aug 11 01:32:03 CEST 2022


Commit: 0940b3575520b5d6ea84d374924e35efd76135cd
Author: Joseph Eagar
Date:   Wed Aug 10 16:31:38 2022 -0700
Branches: temp-sculpt-brush-channel
https://developer.blender.org/rB0940b3575520b5d6ea84d374924e35efd76135cd

temp-sculpt-brush-channel: Fix broken BrushMapping custom curves

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

M	source/blender/makesrna/intern/rna_brush_channels.c

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

diff --git a/source/blender/makesrna/intern/rna_brush_channels.c b/source/blender/makesrna/intern/rna_brush_channels.c
index 2a5d6037c94..7c8762e55fa 100644
--- a/source/blender/makesrna/intern/rna_brush_channels.c
+++ b/source/blender/makesrna/intern/rna_brush_channels.c
@@ -275,6 +275,12 @@ PointerRNA rna_BrushCurve_curve_get(PointerRNA *ptr)
 {
   BrushCurve *curve = (BrushCurve *)ptr->data;
 
+  if (!curve->curve) {
+    curve->curve = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
+    rctf bounds = {0.0f, 1.0f, 0.0f, 1.0f};
+    BKE_curvemap_reset(curve->curve->cm, &bounds, CURVE_PRESET_LINE, CURVEMAP_SLOPE_POSITIVE);
+  }
+
   return rna_pointer_inherit_refine(ptr, &RNA_CurveMapping, curve->curve);
 }



More information about the Bf-blender-cvs mailing list