godotengine / godot

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

[AnimationTree Optimizer] .blend / .glb animation interpolation error #94528

Open RickyYCheng opened 2 months ago

RickyYCheng commented 2 months ago

Tested versions

Godot v4.2.2.stable.mono - Windows 10.0.22631 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3050 Laptop GPU (NVIDIA; 31.0.15.2698) - AMD Ryzen 7 5800U with Radeon Graphics (16 Threads) Godot v4.3.beta3.mono - Windows 10.0.22631 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3050 Laptop GPU (NVIDIA; 31.0.15.2698) - AMD Ryzen 7 5800U with Radeon Graphics (16 Threads)

System information

Windows 10.0.22631 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3050 Laptop GPU (NVIDIA; 31.0.15.2698) - AMD Ryzen 7 5800U with Radeon Graphics (16 Threads)

Issue description

The animation imported in godot is not correct. I created a simple animation using cube in blender[v3.6 lts] and make interpolation of each frame be Constant. Then convert to .glb format. Import both .blend and .glb file into godot.

To import correctly, set FPS in godot to 15, same with blender.

image

godot 4.2.2 linear, lost internal frames

image

godot 4.3-beta3 nearest, but lost internal frames

image

blender


After having some test, i found that if the optimizer is turned off while importing, the Constant anim would be ok (tested in 4.3).

image

Result. Godot 4.3-beta3, optimizer off

image

Import Setting: optimizer off

image

Import Settings: FPS set.

Steps to reproduce

See mrp.

Minimal reproduction project (MRP)

anim_test.zip

RickyYCheng commented 1 month ago

I modified the mr-project and reuploaded it since I referenced a blog, which told me to set the fps of godot and blender to a same value. But it does not work.

RickyYCheng commented 1 month ago

I just find it out and update the content. The correct way is to turn off the Optimizer of AnimationTree.

For Godot 4.3, I dont think this internal frames should be "optimized" in Constant/Nearest mode. And for Godot 4.2.2, the engine just ignored the Constant interpolation mode and just use Linear.