-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Open
Labels
A-AssetsLoad files from disk to use for things like images, models, and soundsLoad files from disk to use for things like images, models, and soundsC-UsabilityA targeted quality-of-life change that makes Bevy easier to useA targeted quality-of-life change that makes Bevy easier to useD-ComplexQuite challenging from either a design or technical perspective. Ask for help!Quite challenging from either a design or technical perspective. Ask for help!
Description
What problem does this solve or what need does it fill?
currently loading Handles from dynamic scenes loaded from a file will give you a weak handle. it would be nice if handles loaded this way were strong so that you don't have to keep a strong handle somewhere else to prevent assets from unloading that are in the scene. this would be necessary if we wanted to store asset dependency paths in scenes.
What solution would you like?
- Remove the Default implementation for Handle; use Handle::weak instead for this functionality
- impl FromWrold for Handle; Access Asset so handle can be strong
- Add set_id method that decrements the current id and increments the new id
What alternative(s) have you considered?
This could also be done with the ReflectComponent implementation but would take significantly more work since that is (as far as I could tell) all auto-implemented with generics.
Additional Info
it would also allow for a nice expansion of dynamic scenes when serialised we could add to the API
fn save_world(
world: &World,
asset_server: Res<AssetServer>,
type_registry: Res<TypeRegistry>,
) {
let scene = DynamicScene::from_world(world, &type_registry);
let ron = scene.serialize_ron_with_dependencys(&type_registry, &asset_server);
std::fs::write("./assets/scene.scn.ron", ron).unwrap();
}this would require the asset server and extract any paths that the handles came from
Metadata
Metadata
Assignees
Labels
A-AssetsLoad files from disk to use for things like images, models, and soundsLoad files from disk to use for things like images, models, and soundsC-UsabilityA targeted quality-of-life change that makes Bevy easier to useA targeted quality-of-life change that makes Bevy easier to useD-ComplexQuite challenging from either a design or technical perspective. Ask for help!Quite challenging from either a design or technical perspective. Ask for help!
Type
Projects
Status
Concrete and Controversial