Skip to content

Panic loading GLB file #15275

Open
Open

Description

Bevy version

0.14.2

What you did

I'm trying to load a GLB file (which I will attach). To reproduce this bug, I forked the standard Bevy asset loading example, and changed it to load my file (humanoid-male.glb) and got the same error.

What went wrong

I get the following error:

thread 'IO Task Pool (2)' panicked at /Users/talin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_gltf-0.14.2/src/loader.rs:700:53:
no entry found for key
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

The actual code which failed was in bevy_gltf, on line 700:

        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()]) // <<< PANIC HERE
                .collect();

Additional information

This .glb file was created in Blender, and then optimized using the gltf-transform npm package. The file displays correctly in web-based GLTF viewer, and loads successfully in three.js.

The file contains multiple scenes, each scene being a different humanoid character.

The only thing unusual about this file is the way that it is exported from Blender: the animations are exported into a different .glb than the models/skins. This is because the same animations are shared between many different humanoid models. However, that shouldn't affect the ability of the file to be loaded.

humanoid-male.glb.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-glTFRelated to the glTF 3D scene/model formatC-BugAn unexpected or incorrect behaviorS-Needs-InvestigationThis issue requires detective work to figure out what's going wrong

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions