godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.12k stars 69 forks source link

Expose the curve editor as a Control node #3244

Open Zireael07 opened 3 years ago

Zireael07 commented 3 years ago

Describe the project you are working on

3D racer; 2D space shooter but the proposal applies to many games (I imagine Thrive would be thrilled to have it)

Describe the problem or limitation you are having in your project

In editor, Bezier curves can be adjusted easily. It is not possible to make a similar editor available at run time (e.g. for end users to adjust colors/lighting on a car or tweak the AI behaviors)

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Exposing the editor Bezier curve control enables all of the above uses and probably more.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

https://user-images.githubusercontent.com/8739690/50339298-66e23c00-0517-11e9-9503-3d80ea857ef2.png

If this enhancement will not be used often, can it be worked around with a few lines of script?

Nope, definitely not 'a few lines'

Is there a reason why this should be core and not an add-on in the asset library?

I don't think addons can expose portions of editor GUI... they'd have to recreate it from scratch and why recreate something that's already there and works well?

Calinou commented 3 years ago

My opinion is that this control should be reimplemented by a third party and exposed as an add-on. Nodes such as ColorPicker are very complex for an exposed control already, and exposing EditorSpinSlider was also a mistake in my book (there's Editor in the name after all). Very few projects actually need to have a built-in curve editor. ColorPicker alone has represented a significant amount of development time for what amounts to two Control nodes.

When we expose built-in editor nodes, we need to make compatibility guarantees that we don't need to make when the node is editor-only. This adds unnecessary friction to editor development. While reimplementing a curve editor sounds like a lot of work, remember that nothing prevents you from copy-pasting the curve editor plugin code and convert it to GDScript manually as long as you keep the MIT license notice.