From 57d05927d626641ebb7db166fcfcf797b880d202 Mon Sep 17 00:00:00 2001 From: Johannes Vollmer <32042925+johannesvollmer@users.noreply.github.com> Date: Sun, 14 Jul 2024 17:42:32 +0200 Subject: [PATCH] update gltf example to use type-safe `GltfAssetLabel::Scene` (#14218) # Objective update the `load_gltf_extras.rs` example to the newest bevy api ## Solution uses the new type-safe code for loading the scene #0 from the gltf instead of a path suffix ## Testing the example runs as expected --- examples/3d/load_gltf_extras.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/3d/load_gltf_extras.rs b/examples/3d/load_gltf_extras.rs index e32dcbd5f4..4cbfcd3929 100644 --- a/examples/3d/load_gltf_extras.rs +++ b/examples/3d/load_gltf_extras.rs @@ -29,9 +29,11 @@ fn setup(mut commands: Commands, asset_server: Res) { }, ..default() }); + // a barebones scene containing one of each gltf_extra type commands.spawn(SceneBundle { - scene: asset_server.load("models/extras/gltf_extras.glb#Scene0"), + scene: asset_server + .load(GltfAssetLabel::Scene(0).from_asset("models/extras/gltf_extras.glb")), ..default() });