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 /intern/cycles | |
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 'intern/cycles')
-rw-r--r-- | intern/cycles/blender/blender_util.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/intern/cycles/blender/blender_util.h b/intern/cycles/blender/blender_util.h index 3625dd45ae2..cbe61e367fa 100644 --- a/intern/cycles/blender/blender_util.h +++ b/intern/cycles/blender/blender_util.h @@ -159,7 +159,7 @@ static inline void curvemapping_to_array(BL::CurveMapping &cumap, array<float> & data.resize(size); for (int i = 0; i < size; i++) { float t = (float)i / (float)(size - 1); - data[i] = curve.evaluate(t); + data[i] = cumap.evaluate(curve, t); } } @@ -197,15 +197,16 @@ static inline void curvemapping_color_to_array(BL::CurveMapping &cumap, BL::CurveMap mapI = cumap.curves[3]; for (int i = 0; i < size; i++) { const float t = min_x + (float)i / (float)(size - 1) * range_x; - data[i] = make_float3(mapR.evaluate(mapI.evaluate(t)), - mapG.evaluate(mapI.evaluate(t)), - mapB.evaluate(mapI.evaluate(t))); + data[i] = make_float3(cumap.evaluate(mapR, cumap.evaluate(mapI, t)), + cumap.evaluate(mapG, cumap.evaluate(mapI, t)), + cumap.evaluate(mapB, cumap.evaluate(mapI, t))); } } else { for (int i = 0; i < size; i++) { float t = min_x + (float)i / (float)(size - 1) * range_x; - data[i] = make_float3(mapR.evaluate(t), mapG.evaluate(t), mapB.evaluate(t)); + data[i] = make_float3( + cumap.evaluate(mapR, t), cumap.evaluate(mapG, t), cumap.evaluate(mapB, t)); } } } |