diff options
author | Jeroen Bakker <j.bakker@atmind.nl> | 2019-11-01 14:09:55 +0300 |
---|---|---|
committer | Jeroen Bakker <j.bakker@atmind.nl> | 2019-11-27 18:05:54 +0300 |
commit | 2e6159a4948cd0f4e0b636734bfe506796bd87f2 (patch) | |
tree | fb04244033e45a69c514ec9a0ac6aa6fd28d5a33 /source/blender/blenkernel/intern/brush.c | |
parent | 6992fc0b3bf85e985169157b2e7ced1e1ed7fcdf (diff) |
Curve: CurveMapping Extend Option
Extend options are currently stored per curve. This was not clearly
communicated to the user and they expected this to be a setting per
CurveMapping.
This change will move the option from `Curve` to `CurveMapping`. In
order to support this the API had to be changed.
BPY: CurveMap.evaluate is also moved to CurveMapping.evaluate what
breaks Python API. Cycles has been updated but other add-ons have
not. After release of 2.81 we can merge this to master and adapt
the add-ons.
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D6169
Diffstat (limited to 'source/blender/blenkernel/intern/brush.c')
-rw-r--r-- | source/blender/blenkernel/intern/brush.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c index 4d496fe758b..27c3df5ce6e 100644 --- a/source/blender/blenkernel/intern/brush.c +++ b/source/blender/blenkernel/intern/brush.c @@ -1069,18 +1069,19 @@ void BKE_brush_sculpt_reset(Brush *br) */ void BKE_brush_curve_preset(Brush *b, eCurveMappingPreset preset) { - CurveMap *cm = NULL; + CurveMapping *cumap = NULL; + CurveMap *cuma = NULL; if (!b->curve) { b->curve = BKE_curvemapping_add(1, 0, 0, 1, 1); } + cumap = b->curve; + cumap->flag &= ~CUMA_EXTEND_EXTRAPOLATE; + cumap->preset = preset; - cm = b->curve->cm; - cm->flag &= ~CUMA_EXTEND_EXTRAPOLATE; - - b->curve->preset = preset; - BKE_curvemap_reset(cm, &b->curve->clipr, b->curve->preset, CURVEMAP_SLOPE_NEGATIVE); - BKE_curvemapping_changed(b->curve, false); + cuma = b->curve->cm; + BKE_curvemap_reset(cuma, &cumap->clipr, cumap->preset, CURVEMAP_SLOPE_NEGATIVE); + BKE_curvemapping_changed(cumap, false); } /* Generic texture sampler for 3D painting systems. point has to be either in |