Flip spline in RSScalarRamp / Invert Gradient in RSRamp not possible in Node Material?
-
Hi there,
In a ShaderGraph material I'm able to flip the spline in a Scalar Ramp node as well as invert the gradient in a Ramp node by using:Flip()
InvertKnots()
Do we have similar methods for the Maxon API?
Do I need to invert the knots and points one by one manually?
If so I'd appreciate any examples.Thanks a lot
-
Hey @danielsian,
Thank you for reaching out to us. I am not the biggest Nodes API expert. @m_adam is our Nodes API expert in the SDK group but he is currently on FMX.
The counterpart to
c4d.GradientData
is maxon.GradientInterface. ForSplineData
the counter part would be maxon::SplineMapperInterface but that has never been wrapped for Python.But material nodes, e.g., RS Ramp or RS Scalar Ramp, decompose gradients and splines into their values. When I poke around in the Node Editor I cannot get hold of the spline/gradient instance for such node. The parent port of the "Ramp" port bundle does not have a data type. And the "Points" port then realizes the points as a variadic port.
So, what I would do, is get values all child ports of the points port and then write them back in reverse order.
As always, tangible code would be better than abstract questions, as I would then not have to guess what you are doing exactly.
Cheers,
Ferdinand -
Thanks @ferdinand, you answered my question brilliantly, as you always do.
Cheers