You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Add AnimationPlayer exposed property use_reset_animation_as_default or something like this.
If checked:
on start, any property present in RESET but not set in the first animation uses the RESET animation value
on animation change, any property set in RESET but not the new animation is reverted to the value in RESET animation (we could also only set it if it was actually set by the previous animation; but it won't reset it if we changed said property as runtime via code, which may be desired or not depending on design)
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:
animation_player.play(&"RESET")
animation_player.advance(0)
animation_player.play(animation_name)
# extra advance required if you do this at the end of the frame,# e.g. in _on_animation_player_animation_finished callback,# to avoid showing default state for 1 frame
animation_player.advance(0)
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:
@timothyqiu I checked your addon again but it says it's not required anymore with the new deterministic flag (apparently added in godotengine/godot#80813), so maybe I can close this issue (I will test it first in my project to be sure).
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.
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: