You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But for many assets, you want to provide different settings for the same asset, depending on the asset collection. You can't rely on the asset meta file because you need different settings per asset collection.
For example, in an RTS game, during a level, you might want to load an asset for the Army. The Army asset itself has some settings that control whether additional assets are loaded. Those assets are not needed during the level, but are used in other scenes in the game. It would be good if bevy_asset_loader had a way to configure the assets settings near the #[asset] macro.
Even the GltfLoader inside Bevy has some settings, and you can imagine scenarios where you want to be able to configure these on a per-asset-collection basis:
pubstructGltfLoaderSettings{/// If true, the loader will spawn cameras for gltf camera nodes.pubload_cameras:bool,/// If true, the loader will spawn lights for gltf light nodes.pubload_lights:bool,/// If true, the loader will include the root of the gltf root node.pubinclude_source:bool,}
I don't know what a solution looks like. It doesn't have to sit next to the #[asset] macro, but that seems like the most obvious ergonomic choice.
BTW, for DynamicAssets, there seems to be a way to achieve this already. Something like this:
Some asset formats like image have special treatment in this crate for configuring the asset on a per-asset-collection basis:
But for many assets, you want to provide different settings for the same asset, depending on the asset collection. You can't rely on the asset meta file because you need different settings per asset collection.
For example, in an RTS game, during a level, you might want to load an asset for the
Army
. TheArmy
asset itself has some settings that control whether additional assets are loaded. Those assets are not needed during the level, but are used in other scenes in the game. It would be good ifbevy_asset_loader
had a way to configure the assets settings near the#[asset]
macro.Even the
GltfLoader
inside Bevy has some settings, and you can imagine scenarios where you want to be able to configure these on a per-asset-collection basis:I don't know what a solution looks like. It doesn't have to sit next to the
#[asset]
macro, but that seems like the most obvious ergonomic choice.BTW, for
DynamicAssets
, there seems to be a way to achieve this already. Something like this:When registering your asset:
And:
This seems to work AFAICT.
Originally raised in Discord.
The text was updated successfully, but these errors were encountered: