If multiple SkinnedMeshRenderer objects reference the same mesh, only one of them will export a skin in glTF. The other copies export as non-skinned meshes.
To Reproduce
This bug was not present in UniGLTF 0.66. It happens only in UniGLTF 0.74.
Currently, it seems that a map is created from Mesh to SkinnedMeshRenderer. This map is used to resolve the corresponding skin object. However, it will fail if multiple SkinnedMeshRenderers share the same mesh.
Instead, I expect each SkinnedMeshRenderer object to create its own glTF skin object, even if the mesh is shared.
In UniVRM 0.66, the duplicate meshes would create different GLTF meshes. This is less ideal, but technically valid. Reverting to this behavior would also solve this issue.
Screenshots
Here is a screenshot showing one copy of the mesh being skinned, and the other mesh being non-skinned:
Validation report for the original input GLB file showing no warnings or errors:
Environments (please complete the following information):
Describe the bug
If multiple SkinnedMeshRenderer objects reference the same mesh, only one of them will export a skin in glTF. The other copies export as non-skinned meshes.
To Reproduce
This bug was not present in UniGLTF 0.66. It happens only in UniGLTF 0.74.
e.g. Steps to reproduce the behavior:
Files: Original input GLB file Incorrect Export GLB from UniGLTF
Expected behavior
Currently, it seems that a map is created from Mesh to SkinnedMeshRenderer. This map is used to resolve the corresponding skin object. However, it will fail if multiple SkinnedMeshRenderers share the same mesh.
Instead, I expect each SkinnedMeshRenderer object to create its own glTF skin object, even if the mesh is shared.
In UniVRM 0.66, the duplicate meshes would create different GLTF meshes. This is less ideal, but technically valid. Reverting to this behavior would also solve this issue.
Screenshots
Here is a screenshot showing one copy of the mesh being skinned, and the other mesh being non-skinned:
Validation report for the original input GLB file showing no warnings or errors:
Environments (please complete the following information):
Additional context