[python] Work with curve


(Pierre Fabre) #1

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).

(Frédéric Devernay) #2

(example at the bottom of the doc)

(Pierre Fabre) #3

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.

(Frédéric Devernay) #4

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:

(Frédéric Devernay) #5

Oh you were actually trying to edit Roto curves.