I was wondering how curves work with python scripts. have you somes examples ? Even if i add somes animations on an effect, i don’t understand how i can edit curve, and i don’t see it in curve editor (ui).
(example at the bottom of the doc)
I was looking for something else, more like setPointAtIndex from BezierCurve class, but i don’t understand how to use it with keyframes from animated param. No way to create interpolation ? or i need to create python expression ?
I want to transform an animated html page into a video. For animations i use gsap, and it’s custom ease https://greensock.com/ease-visualizer . It can give me an output a bit like natron’s curve. So i was wondering if i could use that output to edit natron’s curve with python.
BezierCurve is for roto curves only.
all parameters have a setValueAtTime function. If the parameter is animated and there is no keyframe, this places a keyframe.
see eg DoubleParam:
never forget that a DoubleParam has all these methods:
Oh you were actually trying to edit Roto curves.
- https://natron.readthedocs.io/en/rb-2.3/devel/PythonReference/NatronEngine/Effect.html#NatronEngine.NatronEngine.Effect.getRotoContext to get the right Roto object from the roto node
- https://natron.readthedocs.io/en/rb-2.3/devel/PythonReference/NatronEngine/Roto.html to create a Bezier
- https://natron.readthedocs.io/en/rb-2.3/devel/PythonReference/NatronEngine/Roto.html#NatronEngine.NatronEngine.Roto.getItemByName to get the BezierCurve object
- https://natron.readthedocs.io/en/rb-2.3/devel/PythonReference/NatronEngine/BezierCurve.html to edit it