godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
86.51k stars 19.27k forks source link

Animation bezier tracks without a matching RESET track do not function #92617

Closed krdluzni closed 5 hours ago

krdluzni commented 1 month ago

Tested versions

Regression between 4.3.dev1.official and 4.3.dev2.official

System information

Godot v4.3.beta1 - Windows 10.0.22631 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4090 (NVIDIA; 31.0.15.5123) - AMD Ryzen 9 7950X 16-Core Processor (32 Threads)

Issue description

Edit: Simplified steps with simple MRP, and notes providing a better understanding of the actual, underlying issue are available in comment https://github.com/godotengine/godot/issues/92617#issuecomment-2178816101. This main issue description and steps can be considered outdated as there's a much clearer way to see this issue.

When creating a bezier track in an animation player that only contains keys made via right click on the timeline > Insert key... > modifying the key data in the the AnimationTrackKeyEdit inspector, the bezier track has no effect on the actual scene. This applies both in-game if the animation is played, and when scrubbing through the timeline to preview the animation in the editor.

Steps to reproduce

Edit: These steps reproduce the issue from a blank project, but there is now a better understanding of the issue and simplified reproduction from an MRP available in a followup comment.

  1. Create a new Godot project.
  2. Create a new scene with the following structure (everything positioned at 0,0,0):
    • Node3D
    • CSGBox3D
    • AnimationPlayer
  3. Go the the animation editor and click Animation > New... > OK.
  4. Go to the animation timeline and click +Add Track > Bezier Curve Track....
  5. Pick CSGBox3D.
  6. Pick position as the field to animate.
  7. In the timeline, right click near the start of the animation for CSGBox3D:position:x, and choose to Insert Key....
  8. In the timeline, right click near the end of the animation for CSGBox3D:position:x, and choose to Insert Key... one more time.
  9. Click the second created key to see the AnimationTrackKeyEdit in the Inspector.
  10. In the Inspector, modify the Value field to 5.
  11. Return to the timeline and try to scrub through it. Note that the box position does not visibly change.

Known Workaround (in current version, does not work in all broken versions): If you now scrub to the middle of the timeline, open the Inspector for the CSGBox3D, key the position using the key button in that inspector, and then delete the key frame info made by doing so, suddenly the animation does what it should have at step 11. Something appears to be broken when initially setting up the track, but gets fixed as soon as the key button is clicked, even if the animation keys made that way are deleted.

Minimal reproduction project (MRP)

Edit: An MRP with simpler steps to reproduce is include in a followup comment: https://github.com/godotengine/godot/issues/92617#issuecomment-2178816101.

As the behaviour breaks during the making of the scene, and changes depending on the steps made to create the scene, no MRP is provided. The steps above outline as precisely as possible how to create an animation that does not apply correctly.

krdluzni commented 2 weeks ago

Additional info after further testing: It appears that the underlying issue here is that bezier tracks that do not have a matching RESET track are unable to function. Based on this information I've provided an MRP with simpler reproduction steps, and updated the title to represent the real issue.

Steps to reproduce

  1. Open MRP
  2. Open node_3d.tscn
  3. Select the animation player and ensure the animation named MRP is selected.
  4. Play selected animation from current position.
    • Note that the animation does not have any effect.

If a matching reset track for the animated field is created, the animation will start to work. If that track (or the whole RESET animation) is then deleted, it will again stop working. RESET track must exist for bezier animation to have any effect on the scene.

Updated minimal reproduction project (MRP)

bezier-reset.zip

krdluzni commented 1 week ago

Tested to confirm regression is still present in v4.3.beta2.official [b75f0485b]

matheusmdx commented 1 week ago

Bisecting points to #86687 as the culprit:

image

TokageItLab commented 5 hours ago

Fixed by https://github.com/godotengine/godot/pull/93785