Godot: Add float Curve

Created on 14 Dec 2016  Â·  11Comments  Â·  Source: godotengine/godot

Godot has Curve3D, Curve2D, ColorRamp but no Curve for just floats. This would be handy for defining values changing over time in a determined and smooth way, or defining a custom interpolation.
For comparison, the Unity equivalent is AnimationCurve, and is used in a lot of places in the engine.

I currently need it so i can define the width of a line along its length (rather than having to set every single 50 points for example).

feature proposal core editor

All 11 comments

How should it be called? Curve1D? just Curve? FloatRamp? just Ramp (:smile:)?

Bezier curves will be added to animation editor eventually

On Wed, Dec 14, 2016 at 8:17 AM, Bojidar Marinov notifications@github.com
wrote:

How should it be called? Curve1D? just Curve? FloatRamp? just Ramp (😄)?

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/godotengine/godot/issues/7296#issuecomment-267009167,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AF-Z2ya5W6EhDjoHXBsbDZsaLAPGR00_ks5rH9BJgaJpZM4LMZTH
.

@reduz I guess you are mistaking the issue a bit -- this isn't about AnimationPlayer or AnimationTreePlayer, it is about a Resource which contains a Curve of floats (i.e. a 1D Curve), which can allow for more possibilities than @GDScript.ease() :smiley:

Yeah I meant having a Resource holding that. It can still be useful in other places such as AnimationPlayer though :)

I would call it Curve since there are Curve2D and Curve3D doing the same things (with control points and all). ColorRamp does too in the concept but its implementation differs and its editor is completely different.

I think that a 1 dimension curve called "Curve" will be a bit confusing... "Ramp" sounds better.

Ramp is probably confusing as well -- FloatRamp/RealRamp might be better.. (but, not sure about this actually)

I would enjoy something like this if I could put in x, ranging from 0-1, and it'd return what y was (from 0-1)

a curve editor dialog to adjust a curve in a similar way to the UE4 would be great!

I now have a work in progress based on cubic bezier curves and sorted points. I found access in the form y(x) instead of (x,y)(t) works too, which is nice :)

image

@reduz at the same time, I'm thinking about the CurveTextureEditor, which could use the same algorithm, but what I did so far relies on the fact that the baking is done in the resource rather than the editor plugin (so it can be changed at runtime).

Fixed by #8591

Was this page helpful?
0 / 5 - 0 ratings