NatronGitHub / Natron

Open-source video compositing software. Node-graph based. Similar in functionalities to Adobe After Effects and Nuke by The Foundry.
http://NatronGitHub.github.io
GNU General Public License v2.0
4.68k stars 340 forks source link

Animation Curve Handles #346

Open Chadt54 opened 5 years ago

Chadt54 commented 5 years ago

Natron version 2.3.14 Release. CentOS 7

Any idea if the resizable bezier handles will ever be implemented? In animation having these handles locked makes it very difficult to create animation, so being able to unlock the handles and scale their lengths would be super awesome.

https://github.com/MrKepzie/Natron/issues/386

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/73808075-animation-curve-handles?utm_campaign=plugin&utm_content=tracker%2F83915136&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F83915136&utm_medium=issues&utm_source=github).
devernay commented 5 years ago

Those are not 2D Bezier curves, but 1D cubic curves. Having 2D curves to animate a 1D variable makes no sense. This is similar to Nuke's behavior. An animation curve has to be a function y = f(x), so that for every x you have a value x. A bezier curve is (x,y) = f(s), where s is a curvilinear coordinate. There may be several y values for a single x in a 2D Bezier curve (as in roto curves).

Chadt54 commented 5 years ago

You can do what I'm talking about in Nuke. So, it seems you are misunderstanding.

Click on a curve handle in Nuke, then press Ctrl and mouse-drag the handle to resize it.

image

image

Chadt54 commented 5 years ago

@devernay

devernay commented 5 years ago

Ok. These are cubic curves but not Bézier anymore. Requires some heavy changes in the code. Note that the same result can be obtained using Bézier and adding one or two more control points. Reopening, but that's probably low priority

Chadt54 commented 5 years ago

Thank you!

Chadt54 commented 5 years ago

(It still has the "wontfix" tag added though, that may confuse whoever may try to fix this)

devernay commented 5 years ago

Actually these aren't cubic curves, and I can't figure out the math behind that. If somebody has a reference, this may help. Note that this behavior is not even documented in the Nuke documentation https://learn.foundry.com/nuke/content/getting_started/using_interface/animating_parameters.html#EditingCurves

threedslider commented 5 years ago

I have checked if curve is in Natron, for time being it is linear and though there are function as cubic, catmull rom but not bezier... i don't know if it is a bug not being to work in curve cubic ? Maybe it needs to fixe that.

Chadt54 commented 5 years ago

Maybe it actually is bezier just with forced limitations, like the handle lengths can never pass the ends. If the handles never pass the ends of the curve will there ever be more than 1 'y' solution?

Edit: If you play with the third curve from the left on this website, and drag all the point to the max top/bottom, it seems to me that simply limiting the handles to not go past the edges will indeed result in only a single 'y' value (although, it may need proven, but this animation makes me feel that my hunch is probably correct) https://www.jasondavies.com/animated-bezier/

All the blue/green points end up exactly half way down the middle: image

devernay commented 5 years ago

@threedslider these are 1D cubic curves. Bezier curves is 2D, but we use the same interpolation as Bezier here. The same functions are used for the 1D parameter curves and the roto curves.

devernay commented 5 years ago

@Chadt54 it seems like you're right! I never noticed that! Doing interpolation with a 2D bezier will be a bit more expensive, because going from x to y requires first to solve a cubic to find the curvilinear coordinate s (using Cardano's method), then applying a cubic to get y. This is probably why the default in Nuke (and Natron) is to have the control points at 1/3 and 2/3, which makes s a linear function of x. So yes, it is doable, but require some work.

ezequielleonzybert commented 3 months ago

this

Ok. These are cubic curves but not Bézier anymore. Requires some heavy changes in the code. Note that the same result can be obtained using Bézier and adding one or two more control points. Reopening, but that's probably low priority

I think this is high priority. I just installed the app and the first thing I noticed after 5 minutes using it is the fact that handlers can't be stretched to define the curves as I need. I'm not using Natron only because of this. if Natron devs think this is low priority then they'll have a bunch of users leaving the app.