bevy icon indicating copy to clipboard operation
bevy copied to clipboard

`.gltf` files' `.bin` dependencies aren't copied into `imported_assets`

Open Seldom-SE opened this issue 1 year ago • 1 comments

Bevy version

0.14.0

What you did

Tried to load a .gltf file with a .bin dependency with preprocessing enabled

What went wrong

Its .bin file wasn't copied into imported_assets, so the scene doesn't appear. No errors or warnings.

Additional information

Here's a minimal repro of it working in 0.13: https://github.com/Seldom-SE/testetst/blob/29eeb4d6c5210cf6f9c0b035979281f308e81846/src/main.rs

And here's a minimal repro of the bug in 0.14: https://github.com/Seldom-SE/testetst/blob/1d591976b13f3f4517a787fe5863bffe3ea9bf5a/src/main.rs

And here's the diff between the two: https://github.com/Seldom-SE/testetst/commit/1d591976b13f3f4517a787fe5863bffe3ea9bf5a

Seldom-SE avatar Jul 06 '24 17:07 Seldom-SE

I've run into a similar issue where any gLTF assets with a separate .bin file never load. i.e. calling asset_server.recursive_dependency_load_state(gltf_handle) always yields RecursiveDependencyLoadState::Loading.

I've also got preprocessing enabled.

After a bit of experimenting, I've found that changing the .bin.meta file contents from

(
    meta_format_version: "1.0",
    asset: Ignore,
)

to

(
    meta_format_version: "1.0",
    asset: Load(
        loader: "bevy_gltf::loader::GltfLoader",
        settings: (
            load_meshes: ("RENDER_WORLD"),
            load_materials: ("RENDER_WORLD"),
            load_cameras: true,
            load_lights: true,
            include_source: false,
        ),
    ),
)

allows my gLTF assets to load correctly. Possibly this works for your project as well (as a short-term workaround)?

66OJ66 avatar Jul 11 '24 11:07 66OJ66