X Tutup
Skip to content

Allow resizing the length of animations by dragging the timeline#110623

Merged
Repiteo merged 1 commit intogodotengine:masterfrom
YeldhamDev:time_manipulation
Nov 22, 2025
Merged

Allow resizing the length of animations by dragging the timeline#110623
Repiteo merged 1 commit intogodotengine:masterfrom
YeldhamDev:time_manipulation

Conversation

@YeldhamDev
Copy link
Member

@YeldhamDev YeldhamDev commented Sep 17, 2025

Closes godotengine/godot-proposals#10030.

Screencast_20250917_222534.webm

This also fixes the following bugs:

  • Timeline components overlapping mode buttons in the tracks.
  • Markers drawing outside of bounds.
  • Clipped focus in the bezier editor.
  • Timeline cursor and track name dragging even if the context menu is open.

@F3der1co
Copy link
Contributor

I love it!
But it's missing one thing from the proposal, the darkening across the tracks as can be seen here. I hope this could be added as well.
image

@sszigeti
Copy link

Is there a way to proportionally adjust the keys too (maybe while holding a key like Ctrl or Shift), essentially making the animation slower or faster?

@YeldhamDev
Copy link
Member Author

No. What you're asking for is key scaling, this PR is just for resizing the animation length.

@YeldhamDev YeldhamDev requested a review from a team as a code owner September 18, 2025 01:24
@YeldhamDev
Copy link
Member Author

YeldhamDev commented Sep 18, 2025

I love it!
But it's missing one thing from the proposal, the darkening across the tracks as can be seen here. I hope this could be added as well.

Hoo, boy. Just addressed that part of the proposal, and kinda fell on a rabbit hole of fixing drawing bugs, which now makes this PR a bugfix as well.

The video in the OP has been updated.

@YeldhamDev YeldhamDev added the bug label Sep 18, 2025
@AThousandShips AThousandShips changed the title Allow to resize the length of animations by dragging the timeline Allow resizing the length of animations by dragging the timeline Sep 18, 2025
@ettiSurreal
Copy link
Contributor

Does it support snapping?

@YeldhamDev
Copy link
Member Author

It snaps to the animation step by default, with the option of more granular movement by holding Shift. Basically how it works with keys/markers.

@Nodragem
Copy link
Contributor

What if the animation cursor is at the end of the animation? Would the code prioritise moving the cursor or the animation end?

@YeldhamDev
Copy link
Member Author

The animation end is prioritized. As the cursor can be moved by clicking anywhere below it.

@KoBeWi
Copy link
Member

KoBeWi commented Sep 24, 2025

I created a new animation and it crashed when I tried resizing:

CrashHandlerException: Program crashed
Engine version: Godot Engine v4.6.dev.custom_build (b7c5fcaf1ef716b13e4f229ab9f591a22badbe1b)
Dumping the backtrace. Please include this when reporting the bug on: https://github.com/godotengine/godot/issues
[0] AnimationTrackEdit::get_editor (C:\godot_source\editor\animation\animation_track_editor.h:532)
[1] AnimationTrackEdit::get_editor (C:\godot_source\editor\animation\animation_track_editor.h:532)
[2] AnimationTimelineEdit::gui_input (C:\godot_source\editor\animation\animation_track_editor.cpp:1981)
[3] Control::_call_gui_input (C:\godot_source\scene\gui\control.cpp:1867)
[4] Viewport::_gui_call_input (C:\godot_source\scene\main\viewport.cpp:1751)
[5] Viewport::_gui_input_event (C:\godot_source\scene\main\viewport.cpp:2169)
[6] Viewport::push_input (C:\godot_source\scene\main\viewport.cpp:3507)
[7] Window::_window_input (C:\godot_source\scene\main\window.cpp:1834)
[8] call_with_variant_args_helper<Window,Ref<InputEvent> const &,0> (C:\godot_source\core\variant\binder_common.h:223)
[9] call_with_variant_args<Window,Ref<InputEvent> const &> (C:\godot_source\core\variant\binder_common.h:337)
[10] CallableCustomMethodPointer<Window,void,Ref<InputEvent> const &>::call (C:\godot_source\core\object\callable_method_pointer.h:103)
[11] Callable::callp (C:\godot_source\core\variant\callable.cpp:57)
[12] Callable::call<Ref<InputEvent> > (C:\godot_source\core\variant\variant.h:938)
[13] DisplayServerWindows::_dispatch_input_event (C:\godot_source\platform\windows\display_server_windows.cpp:4459)
[14] DisplayServerWindows::_dispatch_input_events (C:\godot_source\platform\windows\display_server_windows.cpp:4429)
[15] Input::_parse_input_event_impl (C:\godot_source\core\input\input.cpp:979)
[16] Input::flush_buffered_events (C:\godot_source\core\input\input.cpp:1262)
[17] DisplayServerWindows::process_events (C:\godot_source\platform\windows\display_server_windows.cpp:3820)
[18] OS_Windows::run (C:\godot_source\platform\windows\os_windows.cpp:2331)
[19] widechar_main (C:\godot_source\platform\windows\godot_windows.cpp:96)
[20] _main (C:\godot_source\platform\windows\godot_windows.cpp:122)
[21] main (C:\godot_source\platform\windows\godot_windows.cpp:136)
[22] WinMain (C:\godot_source\platform\windows\godot_windows.cpp:150)
[23] __scrt_common_main_seh (D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288)
[24] ShimMainCRTStartup (C:\godot_source\platform\windows\cpu_feature_validation.c:74)
[25] <couldn't map PC to fn name>
-- END OF C++ BACKTRACE --

@YeldhamDev
Copy link
Member Author

@KoBeWi Fixed.

@KoBeWi

This comment was marked as resolved.

@YeldhamDev
Copy link
Member Author

@KoBeWi Fixed that, and also on the timeline cursor and track list resizing as well.

@KoBeWi
Copy link
Member

KoBeWi commented Sep 26, 2025

Right-clicking to cancel still opens context menu. I think it should not.

EDIT:
Also, shouldn't it undo the change?

@YeldhamDev
Copy link
Member Author

Made right-clicking undo the resize operation. Also fixed the cursor and track name dragging still happening when you open the menu.

@fire fire moved this to Ready for review in Animation Team Issue Triage Oct 10, 2025
@lyuma
Copy link
Contributor

lyuma commented Oct 17, 2025

We looked at some of this in the meeting and we want to point out that PR #105151 also exists and implements a bit more of the visuals and maybe a little closer to what we want.

I think it's a little early to say which approach is best since neither change appears to be complete. A video would be helpful too.
Some of the comments we had there might be relevant to this change too:
#105151 (comment)

I don't know why we were confused during the meeting but this PR makes sense. This does not conflict with another PR so I am retracting my comment. I apologize for the confusion.

@F3der1co
Copy link
Contributor

These do not implement the same thing and can co-exist. Or did you link the wrong PR?
This implements dragging to change the animation length of the timeline without modifying the keyframes, it only modifies this property:
image

while #105151 implements scaling of the time between keyframes and does not modify the animation length.

@lyuma
Copy link
Contributor

lyuma commented Oct 23, 2025

I retract my last comment. We were reviewing a bunch of animation PRs and people in the meeting were either looking at the wrong PR or just got confused. Please ignore our earlier comment and I am making a note to look at this again during the next public animation meeting in a week on next Friday. (You're welcome to join too).

@lyuma
Copy link
Contributor

lyuma commented Oct 31, 2025

We discussed this in an animation meeting, and it looks good. we just need to review the code and then it should be good.

Also it would help if you can rebase and fix conflicts. Never mind it seems fixed after I refreshed

@JekSun97
Copy link
Contributor

JekSun97 commented Nov 6, 2025

I can offer more interesting sliders from my suggestions - godotengine/godot-proposals#13583 (comment)
At the moment, the sliders are too primitive, these look like what we are used to seeing in other timelines.

@TokageItLab
Copy link
Member

TokageItLab commented Nov 6, 2025

I can offer more interesting sliders from my suggestions - godotengine/godot-proposals#13583 (comment)

Currently, Animation cannot handle the keys which are on negative time reliably (and this PR doesn't handle start of the animation), so designs that appear to allow manipulation of both ends are not ideal. I believe it is important to clearly indicate that only the animation end (not start) can be manipulated.

@Repiteo Repiteo merged commit 101b827 into godotengine:master Nov 22, 2025
20 checks passed
@github-project-automation github-project-automation bot moved this from Ready for review to Done in Animation Team Issue Triage Nov 22, 2025
@Repiteo
Copy link
Contributor

Repiteo commented Nov 22, 2025

Thanks!

@YeldhamDev YeldhamDev deleted the time_manipulation branch December 1, 2025 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

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

10 participants

X Tutup