bevyengine / bevyengine/bevy

GLTF error message could be more informative

Open
#15,252 0 comments 0 reactions 0 assignees View on GitHub
A-glTF C-Usability D-Straightforward S-Ready-For-Implementation
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## Bevy version

0.14.1

## What you did

I'm loading a GLTF. What's unusual about this GLTF is that the mesh is in a different .glb file than the animation. When I attempt to load the file, I get the following error: `no entry found for key`, which is not very helpful.

The actual error is coming from line 700 in bevy_gltf, which is this line:
```rust
let mut warned_about_max_joints = HashSet::new();
for (&entity, &skin_index) in &entity_to_skin_index_map {
let mut entity = world.entity_mut(entity);
let skin = gltf.skins().nth(skin_index).unwrap();
let joint_entities: Vec<_> = skin
.joints()
.map(|node| node_index_to_entity_map[&node.index()]) // << error is here
.collect();
```

## What went wrong

I got a panic with an error message that was not very informative. I would like it if the error message gave a little more context as to what went wrong.

## Additional information

The reason for having the animations be in a separate .glb is because the same animations are shared between many different humanoid characters. Note that these files load fine in three.js, although I do have to do some fixup post-loading to bind the animations to the mesh.

My next logical step here would be to try and load the GLTF in some kind of standalone viewer so that I can debug it, however it would need to be a viewer which can support separate files like this, which I would probably have to write custom.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.