Skip to content

Commit

Permalink
update gltf example to use type-safe GltfAssetLabel::Scene (bevyeng…
Browse files Browse the repository at this point in the history
…ine#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
  • Loading branch information
johannesvollmer authored Jul 14, 2024
1 parent d008227 commit 57d0592
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion examples/3d/load_gltf_extras.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
},
..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()
});

Expand Down

0 comments on commit 57d0592

Please sign in to comment.