KhronosGroup / KhronosGroup/UnityGLTF
Crashes when exporting skinned mesh with animation when asset optimized
- Dominant language
- C#
- Stars
- 2.2k
- Forks
- 536
- PR merge metrics
- No merged PRs in 30d
Description
### Describe the bug 💬
When exporting an object with animations using UnityGLTF, if the associated mesh asset’s import settings are configured with Animation Type set to Humanoid and the Optimize Game Objects option is enabled, Unity crashes during the process.
### Steps to reproduce 🔢
1. Download the [import_asset_sample.zip](https://github.com/KhronosGroup/UnityGLTF/issues/link-to-file).
2. Extract the files into the Unity project’s Assets folder (the .meta files are pre-configured to trigger the crash).
3. Add the imported model to the scene.
4. Create a new Animator Controller.
5. Add a state to the controller and set its animation clip to one of the animations included in the FBX file.
6. In the scene hierarchy, export the object to either glTF or GLB, it will crash the Unity Editor.
### Files to reproduce the issue ♻
[import_asset_example.zip](https://github.com/user-attachments/files/17973397/import_asset_example.zip)
### Editor Version 🎲
2022.3
### Render Pipeline and version
Not related to the render pipeline
### UnityGLTF Version
2.14.1
### Operating System 👩💻
Windows
### When does this problem happen?
- [ ] Editor Import
- [ ] Runtime Import
- [X] Editor Export
- [ ] Runtime Export
### Additional Info 📜
_No response_
### Validations 🩹
- [X] I have [searched existing issues](https://github.com/KhronosGroup/UnityGLTF/issues): no issue already exist that reports the same problem.
- [X] I follow the [Code of Conduct](https://www.khronos.org/about/code-of-conduct)
- [X] I provided a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example), including files when necessary.
Contributor guide
No contributing guide indexed for this repository
Research direction
Use import_asset_example.zip with Unity 2022.3 and the listed Humanoid and Optimize Game Objects settings to reproduce the crash during Editor Export. Then trace the UnityGLTF export path for skinned meshes with animation and verify that exporting the sample to glTF and GLB no longer crashes the Unity Editor.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, unity
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100