On 05/05/2016 at 08:33, xxxxxxxx wrote:
I'm trying to find different methods for remapping values in python, like the range mapper in xpresso.
I'd like to make a python xpresso node which accepts "spline" user data for remapping data coming into its other inlets.
I know if I'm using xpresso its seems pointless to do this since I can just make an xpresso range mapper node and plug my spline data into that, but I'd like to learn if its possible to it using python only, and see what different approaches there might be.
At the moment it looks like I should use "c4d.utils.Smoothstep(a, b, x)", but I don't think its possible to define the curve?
The mapping is smoothed using an ease-in/ease-out curve.
The smoothed value.
On 06/05/2016 at 01:57, xxxxxxxx wrote:
The Python function similar to the XPresso RangeMapper node is c4d.utils.RangeMap().
The curve optional argument defines the spline to use and it accepts a SplineData object.
Note RangeMap() currently gives wrong results when clamping the output value if clampval argument is True. This issue will be fixed soon.