bevyengine / bevy

A refreshingly simple data-driven game engine built in Rust
https://bevyengine.org
Apache License 2.0
35.18k stars 3.47k forks source link

Support multi loader of same extensions #5003

Open haike0513 opened 2 years ago

haike0513 commented 2 years ago

What problem does this solve or what need does it fill?

The bevy_gltf does not support the other gltf extensions. For example, It does not support the MOZ_hubs_components extensions export by blender plugin hubs-blender-exporter. So I want to add support by my custom asset loader, But when I add a custom asset loader for gltf and glb, It will override the bevy_gltf loader. the AssetServer::add_loader method will override the previous loader. So is it possible to support multi loader for one extension, not just override it.

What solution would you like?

So is it possable to support array loader

mockersf commented 2 years ago

With current Bevy, you can set a custom asset loader for myfilename.hubs.gltf and it would not use the builtin gltf loader. This is using sub-extensions, with several . separations

You could also disable the builtin gltf loader to only have yours, that could then work on any gltf file

haike0513 commented 2 years ago

Maybe it can make the method load_gltf in bevy_gltf loader to be public, so I can use it in my custom loader.