From 2e6159a4948cd0f4e0b636734bfe506796bd87f2 Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Fri, 1 Nov 2019 12:09:55 +0100 Subject: 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 --- intern/cycles/blender/blender_util.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'intern/cycles') 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 & 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)); } } } -- cgit v1.2.3