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

Skeleton doesn't deform mesh when imported as .blend, works fine with .glb #78636

Open
sfreed141 opened this issue Jun 24, 2023 · 7 comments
Open

Comments

@sfreed141
Copy link
Contributor

sfreed141 commented Jun 24, 2023

Godot version

4.0.3-stable_win64

System information

Windows 11, Blender 3.3

Issue description

In a couple .blend files I've noticed the built-in .blend importer results in broken mesh deformation. The skeleton shows up correctly but the mesh itself doesn't deform properly.

The animations work as expected in Blender, and if I export the mesh as a .glb (with all default settings) then importing that works as expected as well. It's definitely possible there's something wrong in the .blend file, but I'd still consider it a bug that the default-exported .glb behaves differently (at least my impression was that these two methods should behave identically).

Imported directly from .blend (skeleton doesn't deform mesh):
image
image
(the bones only deforming some of the mesh objects in this wizard scene hints that maybe there's some trick to getting this to work. I tried messing with reparenting bones, checking weight paintings, and some other misc things but I couldn't figure it out :/)

Imported from .glb (skeleton deforms mesh):
image
image

(both models are from https://quaternius.com/, good stuff!)

Steps to reproduce

Open attached project and open the trex_*.tscn or wizard_*.tscn. Select the AnimationPlayer and see how the deformation works with the *_glb scenes but not the *_blend scenes. I included the .blend and .glb files as well.

Minimal reproduction project

import-issue.zip

@bitsawer
Copy link
Member

Animations seem to work on current 4.1 master branch (68193be) on all four test scenes, so I guess something has been fixed at some point. However, there seems to be some geometry processing issue with the trex_blend.tscn. Looks like it might be LOD related, disabling or adjusting the LOD bias hides the issue. Or maybe the LOD just generates bad versions from a geometry that was wrong to begin with. There are some LOD generation bugs: #57416

.blend imports with strange geometry streching in the highlighted area:

a

LOD blowing up when adjusting the camera angle slightly:

b

@philipp-gaddi
Copy link

i got the same result as bitsawer, but the animations are working and deforming the mesh. i couldn't reproduce the error as sfreed141.
image
setting in the importer tab skins to 4 influences (compatible). seems to solve this. so what is this option changing compared to all influences.

@sfreed141
Copy link
Contributor Author

sfreed141 commented Jun 24, 2023

I can confirm @philipp-gaddi's suggestion to set Meshes > Skins to 4 Influences in the Import tab appears to solve the problem. Thanks!

I'd love to know what that 4 Influences does as well, since there's no in-editor tooltip and the official docs only describe non-.blend import settings (Importing Scenes docs). It'd be great to add docs for all the Import properties under the Blender group

And @bitsawer that's interesting, I just tried on 4.1-beta3 and I see the same behavior as 4.0.3 (no deforms). However the same trick of setting Meshes > Skins to 4 Influences appears to work. I don't see any of the strange geometry issues you noticed on 4.1-beta3 either (LOD related or otherwise).

edit: Just tried on latest master (030c1a9) and I have the same behavior as 4.0.3 and 4.1-beta3. No strange geometry issues, have to set Meshes > Skins to 4 Influences to get deforms working properly. In case it matters my repro steps were

  1. close project
  2. delete the *.import files
  3. open project
  4. create new inherited scene (the pre-made inherited scenes exhibited the same behavior, but I remember when this used to be bugged and the inherited parts wouldn't update. Glad to see that part is fixed now!)

@fire
Copy link
Member

fire commented Jun 25, 2023

Godot Engine supports 8 influences.

  1. Blender export only supports 4 or all (infinity).

Not sure the best approach. I discussed with @julienduroure a few times over the years about this.

See also Vertex bone influence limits for 3D tools

@julienduroure
Copy link

A better option tuning is in todo list and should land in Blender 4.0 or 4.1

@dsyze
Copy link

dsyze commented Sep 21, 2023

I can confirm @philipp-gaddi's suggestion to set Meshes > Skins to 4 Influences in the Import tab appears to solve the problem. Thanks!

I'd love to know what that 4 Influences does as well, since there's no in-editor tooltip and the official docs only describe non-.blend import settings (Importing Scenes docs). It'd be great to add docs for all the Import properties under the Blender group

And @bitsawer that's interesting, I just tried on 4.1-beta3 and I see the same behavior as 4.0.3 (no deforms). However the same trick of setting Meshes > Skins to 4 Influences appears to work. I don't see any of the strange geometry issues you noticed on 4.1-beta3 either (LOD related or otherwise).

edit: Just tried on latest master (030c1a9) and I have the same behavior as 4.0.3 and 4.1-beta3. No strange geometry issues, have to set Meshes > Skins to 4 Influences to get deforms working properly. In case it matters my repro steps were

  1. close project
  2. delete the *.import files
  3. open project
  4. create new inherited scene (the pre-made inherited scenes exhibited the same behavior, but I remember when this used to be bugged and the inherited parts wouldn't update. Glad to see that part is fixed now!)

Thank you so much! That really worked!

@fire
Copy link
Member

fire commented Sep 21, 2023

KhronosGroup/glTF-Blender-IO#1983 Please help us review the Blender 4.0 feature to limit the MAX influences rather than picking either 4 or all.

Godot supports 4 or 8 bone vertex influence (blend weights).

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

7 participants