-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Unused parameters get reset to 0 when animated by an active AnimationNodeStateMachine
AnimationTree
despite nothing explicitly defining them.
#80971
Comments
Note: I also want to confirm that this issue is relevant to the |
I've just bumped into this issue myself (and wasted a few hours trying to figure out what was overriding my node's positions!) It also seems to happen even if there's no nodes at all in the AnimationTree (an empty AnimationNodeStateMachine I mean), just the fact it's linked to an animation player and set to active is enough to set any used property animation tracks to 0 It also appeared not to affect 3D Position tracks, but upon further investigation, they actually crash the game/editor instead when an animation using them is played within the AnimationTree... |
I think this should be pushed to 4.2 since there are probably a lot of things you simply cannot do without a bunch of code to manually override the animations. |
For blending value with bezier tracks, see issue: #49431
@sketchyfun if you found a crash, please PLEASE file a new issue. If it is crashing, it is not a known bug. Include a minimal reproduction project and the version of the engine. Thanks!
Any track which enters the track cache will be output, either to the I could see it being expected behavior that tracks which you do not hit do not output. HOWEVER, note that attempting to fix the system in this way would create a different problem:
So it's a little unclear to me what the expected behavior should be in your case. It ought to be possible to use a track filter to filter for the specific output tracks you want. This might require going through an Finally, note that there is work in progress to overhaul AnimationTree and AnimationPlayer to share a common class rather than having wildly different code. This might make it easier to fix these types of bugs. |
Forgive me, but I'm still having trouble understanding where this issue arises from? If one animation affects position and another affects rotation, why is it that playing (via an AnimationTree) the position animation resets the rotation, and the rotation animation resets the position? I kind of understand that if equivalent tracks are missing in the destination animation then it would need some other values to blend towards (zero, or RESET values I guess?), but surely if there is a blend time of 0, aka no blending between the two animations, then this shouldn't occur? I guess it blends regardless of blend time... Which is strange, as I was expecting the properties to be left alone if moving to a new animation that doesn't touch that particular property. As it is now, it actually makes it kind of useless |
Missing tracks are not processed means that when changing the blend amount of multiple AnimationNodes, the results will not equal depending on the order in which the AnimationNodes are operated by you. We are currently working on unifying AnimationPlayer's blending process with AnimationTree, which should improve this issue. Setting the initial value as Reset works well in many cases in a blending-based system like AnimationTree, but is not ideal for queued playback like AnimationPlayer. The StateMachine works similarly to a queue. However, it relies on the AnimationTree blending process, so internally there is no "fixed animation blending order" such as a "queue"; Simply said, it can't know which animation will be processed first, the current animation or the destination animation of the transition. In other words, there is no guarantee that the playback result will always be correct between the same states in the old blending algorithm. My plan is to refactor the AnimationPlayer/Tree to allow it to not process tracks when initial values are missing as an option (but default value in AnimationPlayey is |
Godot version
4.1
System information
Windows 10
Issue description
I noticed that any parameters being modified across all of my
AnimationPlayer
's Animations get set to 0 (or the RESET track values) when not in use by theAnimationTree
using that player.Example:
I have two animations relevant to a
ColorRect
.In my AnimationNodeStateMachine when I switch between the two animations, the parameters that are not in use by the active animation get reset.
This is with the RESET track values setting the parameters so that the animation reset can be seen:
Without the RESET track the unused parameters between the animations get set to 0 and therefore you cannot see the Rect when the "move" animation is playing since Alpha is set to 0:
This is annoying because you are forced to use multiple AnimationTrees ( and AnimationPlayers considering: #80951 ) for each parameter you wish to modify if you don't want the values to reset themselves.
Deleting the RESET track should nullify this RESET behavior.
Note: I've mainly only used
AnimationNodeStateMachine
s across my projects so I am unsure if this behavior is seen with othertree_root
s.Steps to reproduce
ColorRect
to animate, then create anAnimationPlayer
andAnimationTree
node in your scene.AnimationTree
tree_root to anAnimationNodeStateMachine
and connect the anim_player to the AnimationPlayer in the scene.advance_mode
set to enabled so the user can manually switch between the animations.AnimationTree
and try switching between the animations.Minimal reproduction project
TestProj.zip
The text was updated successfully, but these errors were encountered: