-
-
Notifications
You must be signed in to change notification settings - Fork 97
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 support for animation sync markers #7476
Comments
To some extent, this can be solved by calculating the ratio from the animation length and setting an arbitrary value to NodeScale(SpeedScale). See also godotengine/godot#62623. The algorithm by which AnimationTree gets the length of the child animation is rather obscure, so once it is desynchronized, resynchronization becomes quite difficult. As for the sync marker, do you mean that you want the animation to start at an optional position? I think that can be solved to some extent by firing NodeSeek at any timing. However, I think it would be better to make it the importer's feature to change the start position. |
I am not sure how can we get the current position and length of an animation that needs to be the leader of a sync group so we can use timeseek to match other animations' position? If we can get those values maybe i can work something out from there. |
It is possible to get the remaining time of the currently prioritized animation in AnimationNode with node_blend(test = true), but this is not so convenient since it depends on the internal process of AnimationTree to decide which one is prioritized. This is the same reason:
I don't know if this could be solved by improving the AnimationTree so that each AnimationNode can implement an override for the animation length and start position, but I don't have idea now. |
Yea that would improve things but there are still cases it wouldn't work. For example: We are changing weapons as a layer to the upper body. weapon sway when walking and running should sync with the lower body. Since we don't know when will player change weapons. even if start position and scales matches they will not sync. We would still need a sync group implementation. |
The current solution in that case is to keep all weapon animations in sync behind the scenes. NodeTransition sync can be enabled in 4.0, so if you are using 3.x, use 4.0 or higher. (StateMachine SyncTransiton is still broken currently) |
Ah, that's neat in that case implementing a custom length and start position would work in most cases. |
I find the most efficient way is to get and set time like this. tho it is really cumbersome to do it for all animations. I couldn't find a way to get the length of the animations might need to enter them manually. |
Describe the project you are working on
TPS game with a complex anim tree.
Describe the problem or limitation you are having in your project
I'm trying to move my project from Unreal Engine to Godot. Everything is working smoothly except for one issue. In Godot, there are no sync markers. It makes it impossible to blend locomotion animations correctly. Even if animations have same length and starting with the same foot blending opposite directions causes a clunky and unnatural motion.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
The feature that I need exist in Unreal Engine for a long time and it is self-explanatory. But here is the link to documentation
https://docs.unrealengine.com/5.1/en-US/animation-sync-groups-in-unreal-engine/
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Similar to Unreal Engine in AnimPlayer we add sync markers to our animations.
Inside AnimTree we select Sync Group, Role, and Method
Then System adjusts the playback position and speed based on sync markers.
If this enhancement will not be used often, can it be worked around with a few lines of script?
No
Is there a reason why this should be core and not an add-on in the asset library?
It is about the core of animation synchronization
The text was updated successfully, but these errors were encountered: