godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.13k stars 86 forks source link

Add a visual way to edit the AnimationPlayer's ⏰ Animation Length #10030

Open coppolaemilio opened 3 months ago

coppolaemilio commented 3 months ago

Describe the project you are working on

A small game on my free time :)

Describe the problem or limitation you are having in your project

If you make use of the AnimationPlayer, you will notice that you can't really change the duration of the animation with your mouse. You have to search for a text input and write in the number you are looking for. This is not how any software of the sorts works, and having to type out the seconds makes it really unintuitive. image

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

Adding a "drag and drop" playhead that allows you to change this at any time would fix the issue. For reference, in Davinci Resolve (and in all other video editing software) you can do this by simply changing a line on top of the editor or the end marker:

Davinci Resolve

https://github.com/godotengine/godot-proposals/assets/2206700/c0fb2515-32dd-4b54-b857-6096021ed1b1

Logic Pro

https://github.com/godotengine/godot-proposals/assets/2206700/196565d0-73ed-4117-a634-65243a1dafd3

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

It would work similarly to any other program. Here is a mockup: How it is right now: image

Added the gray triangle at the end of the timeline: image

When you move it by drag and dropping it, the animation lenght gets updated: image

Edit 1 (based on @phantomdesvin feedback). Made the "outside" of the timeline be darker so you have a vertical separation of where the timeline ends.

image

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

It unfortunately can't.

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

I don't think you can make this work reliably as an addon. It is a basic functionality of any editing software.

vvvvvvitor commented 3 months ago

I swear every time I'm working with AnimationPlayers I try doing that and go "Oh yeah, this is Godot".

phantomdesvin commented 3 months ago

I love the idea. On top of that I would add also a vertical visual hint. If you have a lot of tracks it's easy to have a hard time knowing where the time ends on tracks that are vertically far from the little triangle. In your references, Davinci and Logic both use a vertical visual hint, which is just that change in tone that goes down vertically crossing the tracks.

coppolaemilio commented 3 months ago

Thanks for that comment @phantomdesvin ! Added an extra image with a darker "outside area" for the timeline.