Skip to content
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

AnimationTree seek nodes don't reset after preview in editor #39734

Open
RobTheFiveNine opened this issue Jun 21, 2020 · 1 comment
Open

AnimationTree seek nodes don't reset after preview in editor #39734

RobTheFiveNine opened this issue Jun 21, 2020 · 1 comment

Comments

@RobTheFiveNine
Copy link
Contributor

Godot version:
3.2.1.stable.official

OS/device including version:
Ubuntu 18.04

Issue description:
When adding a seek node to an AnimationNodeBlend in an AnimationTree, the value of the position parameter resets to -1 after the initial seek (as it is supposed to), but when previewing this in the editor by toggling the Active property of the AnimationTree, the value does not reset; meaning any seek values that were setup need to be reconfigured every time the animation is previewed in the editor.

Steps to reproduce:

  • Add an AnimationTree
  • Set the tree root to be an AnimationNodeBlend
  • Add an Animation node linked to a Seek node and set the position parameter to a positive value (e.g. 0.5)
  • Enable the Active property of the AnimationTree to start a preview of the animation in the editor
  • Disable the Active property of the AnimationTree to stop the preview

After doing this, the seek parameter in the editor will remain at -1 as per the screenshot below (meaning you would need to make note of the value of all seek nodes before previewing so they can be reconfigured):

image

@TokageItLab
Copy link
Member

TokageItLab commented Dec 7, 2020

Does that mean you always want to keep the animation frame at 0.5? The current SeekNode is a feature that forces the source animation to move to a target frame during one frame (and it ignores other SeekNode, TimeScaleNode), so it is not a bug.

Perhaps what is needed is a node with the ability to always keep a target frame with the Active: bool option, using the current SeekNode, you can reproduce the wanted behavior by continuing to set the same frame in the script. However, in any case, this is a bad matching with the #41728 method of calculating the root motion. If the position of the frame back after the seek, it will be always recognized for time rewinding because the root motion cannot know whether it was rewound by the loop or not: this means that you will not be able to loop the root animation during the animation seeking

The ideal implementation would be to rename the current SeekNode to SeekOneShotNode and implement a new SeekNode with two options, Active: bool and Looped: Int.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants