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
Add markers to Animation #91765
base: master
Are you sure you want to change the base?
Add markers to Animation #91765
Conversation
053d6dd
to
8926c10
Compare
Exists the possibility to can loop a specific section only for a finite number of cycles? |
It would be easily implementable by GDScript when/if #89525 gets merged. |
I'm interested in markers for animation, will try to review for Godot Engine 4.4. |
8926c10
to
2f9db78
Compare
I had been discussing and supervising on discord with @chocola-mint before this was sent, so this PR should be quite clean in terms of architectural design. I will test the behavior in more detail later, but I send feedback at this stage: AnimationPlayer needs an api to set/unset section during playback. It corresponds to the enabling of the use custom timeline option in the AnimationNode in AnimationTree. The API allows for A-B repeats in a BTW sorry, since the use custom timeline option in AnimationNode is newly implemented and I found a problem with the offset being inverted. I have sent an urgent PR about this as #91822 and would appreciate it if you could take a look at it and proceed with the implementation. The warning about duplicate names when adding markers is not needed. It should be consistent with the GUI when adding other animation resources. New icons for markers need to be added. How about the following? |
2f9db78
to
449afd1
Compare
godot_anim_markers_v4_8.mp4 |
56a12f1
to
08afead
Compare
64cc413
to
63c1433
Compare
For usability, can the marker name be displayed in tool tip when focused? Also, it would be helpful to have a shortcut such as ctrl+m (or other shortcut is fine as well as it doesn't conflict) to display the name under the all markers. |
Markers could also be given a color (either random with a seed based on their name1, or a custom color) so you can distinguish them from each other. Footnotes
|
f03e274
to
3ec16c4
Compare
3ec16c4
to
3c51788
Compare
godot_anim_markers_v4_9.mp4(Shortcut: Key M when AnimationMarkerEdit is focused) As it's not possible to force the tooltip to show up on demand, I've opted to just draw the markers' names beneath their marker keys. Would this work? As AnimationMarkerEdit is currently a descendant of AnimationTimelineEdit in the scene tree, it will be drawn before other AnimationTracks, and so the marker names will get darkened by AnimationTrack groups. I haven't figured out a workaround for this yet, unfortunately. |
This is looking pretty neat and it's really exciting having markers in Godot. Also, these are more cosmetic suggestions, but I think they would be nice additions:
|
I don't think this needs to be changed since we are already using the same color code as the animation key; Perhaps currently it have used multiplication for coloring, so it just has to be reverted back to the original color during the selection. In other words, coloring should only be done when it is not selected. However, I agree with the rest. |
Bugsquad edited:
This PR introduces a marker system for Animations. Markers are keys that are inserted alongside the timeline, and can be used to play specific parts of animations. A pair of markers is called a section.
For the Animation resource class, there are now new methods to query marker information with.
For AnimationPlayer, there is now a new
play_section
method that can be used to specify a pair of markers that denote a playback section.play
method is equivalent to passing empty strings as start and end markers toplay_section
.in which case the AnimationMixer effectively does nothing while playing the out-of-range part of the section. (FEEDBACK WELCOME: Is this behavior desirable?)The AnimationMixer will clamp the end of the section so it does not exceed the Animation's length.play_section
uses the original Animation's loop mode.godot_anim_markers_v4_7.mp4
For AnimationTree, specifically AnimationNodeAnimation, Custom Timelines can now be configured using the
Set Custom Timeline from Marker
button.godot_anim_markers_v4_5.mp4