GafferHQ / gaffer

Gaffer is a node-based application for lookdev, lighting and automation
http://www.gafferhq.org
BSD 3-Clause "New" or "Revised" License
962 stars 207 forks source link

Animation Curves #4306

Closed proberts-cinesite closed 2 years ago

proberts-cinesite commented 3 years ago

Summary

Implement cubic interpolation of values between animation keys Each key will need in and out tangents. The Animation Editor will need to be able to display the interpolated curve spans and tangents for a key and provide a mechanism to visually manipulate the curve shape via the tangents.

ericmehl commented 3 years ago

Would it be possible to implement this as a widget that can be used for things besides animation? Ideally a widget with access to the control points and tangents similar to the current SplineWidget.

Before long I will need to have a similar cubic spline for shaders (with tangent controls and a range not restricted to 0-1 that the current spline implementation enforces). A little more discussion here for context: https://github.com/ImageEngine/cortex/issues/1119

A short look at the AnimationGadget code makes it look like this might not be very straightforward, so perhaps it's best handled as a new widget or generalizing the animation gadget in a follow-up effort?

andrewkaufman commented 3 years ago

I don't know if this should be the same issue or separate, but in addition to cubic interpolation we're needing stepped/block interpolation (ie. hard jumps between values) which will require a new basis type added to the StandardCubicBasis enum. This is, for example to animate visibility swaps on frame or to turn lights on/off.

ericmehl commented 3 years ago

Also, I'm happy to contribute if it would help. I realize my request may be unique to my needs.

johnhaddon commented 3 years ago

I don't know if this should be the same issue or separate, but in addition to cubic interpolation we're needing stepped/block interpolation (ie. hard jumps between values) which will require a new basis type added to the StandardCubicBasis enum. This is, for example to animate visibility swaps on frame or to turn lights on/off.

The Animation node already supports stepped interpolation, and it doesn't use any of the StandardCubicBasis stuff. Is your request related to the SplinePlug and shaders rather than the Animation node and compute? If so, that's definitely a separate issue.

Would it be possible to implement this as a widget that can be used for things besides animation? Ideally a widget with access to the control points and tangents similar to the current SplineWidget.

It might be, but I'm wary of generalising too much at this stage. There are also some design choices for Animation::CurvePlug that relate to dealing with a high volume of keys that might make it less useful for your use case (which I presume is VRay shader splines?). An individual key in Gaffer is not a plug, so you couldn't connect another texture or other input in to a spline value, as you can with SplinePlug, where each point in the spline is a child plug in its own right.

ericmehl commented 3 years ago

(which I presume is VRay shader splines?). An individual key in Gaffer is not a plug, so you couldn't connect another texture or other input in to a spline value, as you can with SplinePlug, where each point in the spline is a child plug in its own right.

Exactly, this is for VRay shader ramps. I'll take a closer look at the animation code when this feature is added and see if I can propose a good way of generaliz(s)ing what parts we can.

boberfly commented 3 years ago

Hey all,

I'm a bit late to the party, but was it discussed that it might be pretty cool to be compatible with AnimX? https://github.com/Autodesk/animx