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

Only 4 bone weights per vertex exported/imported when Unity supports up to 256 #722

Open
katas94 opened this issue Apr 2, 2024 · 2 comments

Comments

@katas94
Copy link

katas94 commented Apr 2, 2024

I found out that more than 4 bone weights per vertex are not supported for import/export. Both in the exporter and importer code you are using the old UnityEngine.BoneWeight struct. Unity has now a preferred API which uses the UnityEngine.BoneWeight1 struct that supports up to 256 bone weights per vertex. Right now any mesh using this functionality will be ignored by the exporter and any imported glTF with more than 4 weights will also be clamped.

Here is the Unity docs for reference: https://docs.unity3d.com/ScriptReference/BoneWeight1.html

Importer/Exporter code should be updated to use that API instead of the old struct to support more weights per vertex.

@hybridherbst
Copy link
Collaborator

Hey, thanks for the issue.

Please add test meshes that reproduce the issue (GLB files or zip with glTF for import issues, .unitypackage for export issues) so that we can reproduce. Bonus points for test files that have permissive licenses and can be added to public test datasets!

@hybridherbst
Copy link
Collaborator

hybridherbst commented Apr 2, 2024

Support for more than 4 weights across the glTF ecosystem is pretty low, the glTF spec itself says "applications MAY support more than 4". I think this table is still accurate: https://gist.github.com/donmccurdy/4cad2039360fbd7cd55d18b3f0428581

For future reference, here's a file with 36 weights affecting each vertex, which basically doesn't play correctly anywhere but Blender: ManyBoneWeights36.glb.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants