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

GLB/GLTF Animated Mesh Stretching #62403

Open
TokisanGames opened this issue Jun 25, 2022 · 3 comments
Open

GLB/GLTF Animated Mesh Stretching #62403

TokisanGames opened this issue Jun 25, 2022 · 3 comments

Comments

@TokisanGames
Copy link
Contributor

TokisanGames commented Jun 25, 2022

Godot version

3.5-rc4

System information

Win 10/64 NVIDIA GeForce GTX 1060/PCIe/SSE2

Issue description

I have an animated mesh that stretches too far and deforms improperly. It's coming into Godot via Blender 3.1.2 & GLTF.

Here's what the GLB looks like in MS Windows 3D Viewer and Blender. The wings are round and full, and the points on the back are somewhat evenly spaced.
image

In Godot, the wings completely lose their shape at certain points in the animation.
image

Weight painting looks normal:
image

In another part of the animation, 3D Viewer and blender are again normal. The wing points are evenly spaced. Notice the last one, and how far away from the tail it is, and how it's lined up with the other wing points.
image

In Godot, the wing tips stretch back way too far, coming to the same level as the tail. Notice the last wing point is stretched very far compared to the other wing points.
image

To troubleshoot it, we tried enabling or disabling all of these import/export options, but none had any effect.
Blender

  • Animation/Optimize Animation
  • Animation / Export Deformation Bones Only
  • Skinning / Include all bone influences

Godot

  • Octehedral compression
  • Compress weights
  • Animation Optimizer

We ran into #56705 as enabling the >4 bone weight influences option on blender export caused Godot to strip out the material slot. Disabling that option brought the material slot back in 3.5-rc3. rc4 loads the material slot just fine with all influences enabled.
Here's the blender original, which is the best.
image
Here's what allowing only 4 bone weights looks like (export to glb and reimport to blender).
image
Here's enabling >4 bone weight influences and reimporting to blender. Much smoother:
image

I tried an FBX export and just got garbage.

Steps to reproduce

  • Load MRP
  • Add a light.
  • View the animation in the animation player.
  • See the deformed wings around 1.6s and the stretched wings worst at 2.1s.
  • Load the GLB in MS 3D Viewer or Blender and compare.
@fire
Copy link
Member

fire commented Jun 26, 2022

Can you test the quality with
Screenshot 2022-06-26 164411

this option is off. If the animation is hefty use the compression option.

And make a before and after video of two versions.

@fire
Copy link
Member

fire commented Jun 26, 2022

Godot 3 does not support 8 weights. You can try the recent bone weight truncation patch.

#61912

@TokisanGames
Copy link
Contributor Author

#61912 is in the latest rc, which does load the mesh w/ materials, rc3 does not.

The dialog you're showing is in Godot 4? I'm using Godot 3.5-rc4/5. I went through the optimizer options on the Import panel and none have any effect, on or off. In the animation player I used both the optimize animation and clean up animation functions under Edit. Neither had any effect on the distorted wings or stretched wings.

I took the model into Godot 4 alpha 10 and it looks normal. Neither issue is present. The unoptimized, uncompressed animation looks great. The optimized version looks like stop motion, even if I increase it to 60fps, and doesn't look good at all. The compressed version has a few artifacts in the way the legs move. Neither the optimized or clean functions distorted the wings, it just caused artifacts in leg or head position.

Alright, we're fine as we're going to begin porting to Godot 4 soon anyway, but Godot 3 does have a problem.
We can close this or keep it open depending on if you want to fix Godot 3.

Thanks.

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

4 participants