-
-
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
Animation Player: reset track properties not present in current animation to RESET values #6417
Comments
I was about to make the same proposal. Currently, my approach to solve the problem is to go through all the existing animations and add a keyframe manually :( Edit: Created a plugin to "define the same extra properties on every animation" https://github.com/timothyqiu/godot-animation-resetter |
@timothyqiu I checked your addon again but it says it's not required anymore with the new That said, the deterministic flag was really focused on blending float properties and it seems that applying proper reset on properties in general was more like a side effect of it, which is great but not really explained in the tooltip. So it may be good to explain it better in the tooltip / documentation so people who want to force RESET properties know what to do. In addition, there may be some devs who need to RESET properties but don't want deterministic blending (I don't have an example in mind, since I'm working with non-blended frame-by-frame animations), in which case we may prefer yet another flag to force property reset. So I'll keep this issue open for now. I'd like to gather more feedback from other devs to know what they want too. |
The deterministic flag in the AnimationPlayer does not reset unkeyed values to their "RESET" value at the start of an animation. |
Describe the project you are working on
A platformer with 2D sprite animations
Describe the problem or limitation you are having in your project
Extra track properties not present in all my animations, such as brightness value, are not reset to their default values set in scene nor to RESET animation values when switching from an animation using them to a new animation not using them.
This causes leftover properties as in the GIF below where the character keeps their Hurt animation brightness after restart to Fall and Idle animation:
When Hurt animation overrides brightness:
but Fall and Idle do not:
I added the tracks to RESET animation, to no avail:
According to the documentation, this is by design as RESET is only used when Saving in editor.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Adding an option to AnimationPlayer to reuse RESET property values as default track animations would make runtime benefit from this nice editor feature.
This is similar to Unity's "Write Defaults" property (https://docs.unity3d.com/Manual/class-State.html), which is very convenient to avoid defining the same extra properties on every animation when only a minority of them really need to animate them.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
use_reset_animation_as_default
or something like this.Note: for blended transitions we'd need to think a little more how to work. I suggest to use the RESET animation value as if it was actually defined in the target animation not having it, and blend toward it.
If this enhancement will not be used often, can it be worked around with a few lines of script?
It can be worked around via code by switching to RESET animation, forcing properties refresh then switching to wanted animation. I tested the following code below and it works:
Alternatively, if you know which extra properties are missing from some animations, you can manually reset them in code.
It can be worked around by changing data, but you need to add missing properties to every animation.
Is there a reason why this should be core and not an add-on in the asset library?
Yes, it's adding a field to built-in AnimationPlayer.
The text was updated successfully, but these errors were encountered: