Add LoadContext::load_direct_with_settings
or similar
#12963
Labels
A-Assets
Load files from disk to use for things like images, models, and sounds
C-Enhancement
A new feature
What problem does this solve or what need does it fill?
There's currently no way to pass loader settings for assets you wish to fetch via
LoadContext::load_direct
. I wanted to load a Gltf dependency withGltfLoaderSettings::include_source
and traverse it myself in anAssetLoader
.What solution would you like?
I'd be fine with a simple addition of
load_direct_with_settings
, though perhaps it gets a bit much with all the permutations of arguments ifload_direct_with_settings_from_reader
were to be added as well.I would therefore suggest that there are only two load functions returning handles (
LoadContext::load
,LoadContext::load_from_reader
) with anOption
argument for settings in both, and then have oneasync LoadContext::get_direct(Handle) -> Result<ErasedLoadedAsset, E>
, with the added benefit of being able to await any asset Handle.What alternative(s) have you considered?
Afaikt, the alternative is to wait for the dependency to load by listening to Events in a system. It's doable, but quite clunky compared to the async provided by the AssetLoader interface.
The text was updated successfully, but these errors were encountered: