-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve usability of zooming in the animation editor #85142
Improve usability of zooming in the animation editor #85142
Conversation
ceab9b5
to
3ad79d4
Compare
3ad79d4
to
df8cc28
Compare
I like it! @TokageItLab What do you think? |
df8cc28
to
8ebe33a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally, there are some issues:
- The zoom is slightly offset from the mouse cursor position (or the center when using the zoom bar). This seems to vary depending on the key column's size and the editor window width.
- Editor scales above 100% further offset the zoom (see the second video). Perhaps some multiplying/dividing by
EDSCALE
needs to be done somewhere.
This has the potential to be a big productivity boost, so it's encouraging to see this being worked on nonetheless 🙂
100% editor scale
simplescreenrecorder-2023-11-22_22.36.55.mp4
200% editor scale
simplescreenrecorder-2023-11-22_22.39.45.mp4
I think it is a good way to go for improvement. I will test it as soon as some of the points already pointed out are fixed. |
8ebe33a
to
2b85213
Compare
Thank you for pointing the issues out, the zoomed timeline length was not calculated correctly. Should be fixed now! |
2b85213
to
00a5415
Compare
@TokageItLab do you want to give it a try? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally (rebased on top of master
d76c1d0), it works as expected (tested at 100% and 150% scale factors).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When using the mouse wheel, it makes sense and works correctly based on the current cursor position. Nice work.
However, when using the slider in the lower right corner, the zoom should be based on the current position (e.g. Affter Effects bahave that). Especially when changing the zoom factor from small to large, I believe it is an odd behavior to have the end of the animation as the reference.
Current this PR:
sl1.mp4
FYI Affter Effects:
sl2.mp4
Thanks for the suggestion @TokageItLab , makes sense. Something that I don't like about AfterEffects' approach though is that the timeline view switches position such that the cursor is centered upon zooming (0:06 in the video). I think this is quite distracting/disturbing, and it would be more appropriate if the zoom focused on the cursor, but didn't make the timeline jump around, like this: However then, an edge case that makes that approach problematic, is what to do if the cursor position is outside the currently displayed range. It might again be distracting or disturbing if it automatically switches to the middle, but with the current approach it is unclear what the zoom is actually focusing on. Alternatively, I could test for this case, and then just zoom on the middle of the timeline as before, but I'd like to know what you think. |
I think if the cursor is not visible at the moment zooming into the middle makes sense. |
@TokageItLab would you like to see any other changes? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now it seems to be working fine overall.
One concern is that the center appears to shake when zooming with the slider, so it would be nice if this could be removed, but it can be followed up later as another PR.
wiggled_current.mp4
ea591f3
to
5426769
Compare
Fixed comment style, added #define constant, and added a tiny offset to prevent the wiggling that @TokageItLab mentioned. I think the PR is ready for merge now. zoom_slider3.mp4 |
5426769
to
26688c1
Compare
any other requests? I'd be happy to finish this by the end of the year 😄 |
@@ -1239,6 +1239,59 @@ void AnimationMultiTrackKeyEdit::set_use_fps(bool p_enable) { | |||
} | |||
|
|||
void AnimationTimelineEdit::_zoom_changed(double) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the variables here be float
? Most methods called here use float.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure. get_value()
returns a double, and hscroll
(derives Range
) expects a double, so I thought I'd just do all calculations with doubles. Should I change everything to be a float instead?
ac81bbe
to
a720758
Compare
a720758
to
5b3d5e0
Compare
Thanks! And congrats for your first merged Godot contribution 🎉 |
Thank you!! 😊 |
This PR seeks to improve the zoom usability in the AnimationPlayer editor, I would be happy to hear your feedback! Especially the changes I had to make to the header file is something that a more experienced pair of eyes should be laid on.
I added some code in the AnimationTrackEditor, such that zooming with the mouse zooms in on the current mouse position, whereas the zoom panner always zooms in on the center of the currently visible timeline, instead of zooming on the beginning in both cases.
This implementation comes as a result of the proposal #6204
I have never contributed before, so please bear with me :)