I have referred to https://blenderartists.org/t/how-to-modify-rgb-curve-nodes-in-compositor/503936 hoping the technique would be same or similar for shader nodes. I have also checked Is there a way of keyframing RGB curves? and How to make preset for RGB curves in compositor
-- where, in passing, the high-voted answer needs a typo correcting, from: (RGB_Curves_Node).mapping.curves.points[id].location_x to: (RGB_Curves_Node).mapping.curves.points[id].location.x and same for y.
In this, "id is used to access which point you want the property from. Also, the 'R', 'G', 'B' and 'C' curves are separated by id 0, 1, 2, 3 respectively."
Therefore I script:
rgbC = nodes.new(type='ShaderNodeRGBCurve') rgbC.mapping.curves.points.location = (0,0) rgbC.mapping.curves.points.location = (0.48,0.675) rgbC.mapping.update()
But, although 'points' is set correctly, the curve does not bend, and a straight line then goes from an existing end point through the new one -- having lost its 'other end' anchor (that presumably would have made it bend?). If I try and anchor both ends (0,0) and (1,1), then when adding the 3rd point so:
rgbC.mapping.curves.points.location = (1,1)
I get an 'index out of range' error.
Any help on properly adding and setting points would be much appreciated, thanks.