KhronosGroup / KhronosGroup/UnityGLTF

Missing bones cause files to be unreadable externally

Open
#873 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
2.2k
Forks
536
PR merge metrics
No merged PRs in 30d

Description

### Describe the bug 💬

I am exporting an unpacked prefab that has a missing bone or two.
what i expect to happen is the group with a missing bone will be ignored, and the model will export normally.
instead what happens is the missing bone is replaced with the next in the list, causing 2 issues.
1. in unity, the order of the bones is now incorrect, scrambling the parts.
2. other applications, like blender, cannot read the file due to an index mismatch

### Steps to reproduce 🔢

1. use any rigged model
2. unpack the file
3. delete a bone
4. export

done, it should be messed up.

### Files to reproduce the issue ♻

personal files unnecessary, i went and tested with several assets, all with the same result.

### Editor Version 🎲

2022.3

### Render Pipeline and version

Built in render pipeline

### UnityGLTF Version

latest

### 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

Reproduce the issue in Unity 2022.3 with a rigged model by unpacking it, deleting a bone, and using editor export. Trace the editor export path for missing-bone handling and compare the exported bone order and indices with the original model. Done means the affected group is ignored, bone order remains valid, and the file opens in Unity and external tools such as Blender.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, unity
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.