godotengine / godot

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

3D model deforms when playing animations in Godot 4 #72998

Open Miartsix opened 1 year ago

Miartsix commented 1 year ago

Godot version

4.0.rc1

System information

Windows 10, Vulkan, NVIDIA GeForce GTX 1060 6GB driver version: 27.21.14.5751

Issue description

When opening a glb. file exported from Blender, the animation works correctly on multiple versions of Godot 3, but deforms in Godot 4. I tried changing some exporting settings in Blender and import settings in Godot, but nothing helped. issue_2 issue_1

Steps to reproduce

  1. Open the model as a new inherited scene
  2. Play the animation

Minimal reproduction project

Issue_project.zip

clayjohn commented 1 year ago

This is an issue with our current Auto-LOD generator. The auto LODs are being used much too early and they quality is not good for animated meshes.

You can work around it by disabling LOD generation in the import menu or increasing the LOD bias on the MeshInstance3D

Part of https://github.com/godotengine/godot/issues/57416

fire commented 1 year ago

Working on fixing this with https://github.com/godotengine/godot/pull/73734

fire commented 1 year ago

I tested in the latest, I think the AABB changes in Godot Engine 4.1 may have fixed.

clayjohn commented 1 year ago

I tested in the latest, I think the AABB changes in Godot Engine 4.1 may have fixed.

Is it fixed, or does it just not appear until the camera is further away than before?

ydeltastar commented 8 months ago

Just tested in 4.1.2 and it's not fixed. I run into this issue a lot while working with animated characters. The bone structure looks fine in the editor but some parts of the mesh are deformed.

It only happens when the model is an Editable Children. If I uncheck Editable Children, it keeps deformed in the editor but works in runtime. If I restart the editor, it is fixed in the editor too. I can reproduce the same behavior in the minimal reproduction project here. Looking at the git diff of the scene, it saves bones rotations when it's an editable children causing the issue and when you disable it it removes these rotations from the scene file fixing the issue. I guess it is ignoring AnimationPlayer's reset_on_save feature or it is not implemented for Skeleton3D since imported 3D animations don't have a RESET animation, that would be Skeleton3D's rest pose instead.

fire commented 8 months ago

If it's a caching reloading but there are some fixes in that direction. https://github.com/godotengine/godot/pull/82471

ydeltastar commented 8 months ago

I tested with a build of #82471 but it doesn't have any effect on the issue.

Disabling LODs generation fixed it in 4.1.2 so the saved bone rotations might be irrelevant. It should still reset on save thought since it creates unnecessary diffs but that sounds like a case for a different issue.