Skip to content

Commit 2ab1f8d

Browse files
committed
Update the examples to use the GltfSubassetName.
1 parent 951fb5a commit 2ab1f8d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+92
-88
lines changed

examples/3d/anti_aliasing.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ fn setup(
438438

439439
// Flight Helmet
440440
commands.spawn(SceneRoot(asset_server.load(
441-
GltfAssetLabel::Scene(0).from_asset("models/FlightHelmet/FlightHelmet.gltf"),
441+
GltfSubassetName::Scene(0).from_asset("models/FlightHelmet/FlightHelmet.gltf"),
442442
)));
443443

444444
// Light

examples/3d/atmosphere.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ fn setup_terrain_scene(
236236
commands.spawn((
237237
Terrain,
238238
SceneRoot(
239-
asset_server.load(GltfAssetLabel::Scene(0).from_asset("models/terrain/terrain.glb")),
239+
asset_server.load(GltfSubassetName::Scene(0).from_asset("models/terrain/terrain.glb")),
240240
),
241241
Transform::from_xyz(-1.0, 0.0, -0.5)
242242
.with_scale(Vec3::splat(0.5))

examples/3d/atmospheric_fog.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ fn setup_terrain_scene(
6767

6868
// Terrain
6969
commands.spawn(SceneRoot(asset_server.load(
70-
GltfAssetLabel::Scene(0).from_asset("models/terrain/Mountains.gltf"),
70+
GltfSubassetName::Scene(0).from_asset("models/terrain/Mountains.gltf"),
7171
)));
7272

7373
// Sky

examples/3d/clearcoat.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ fn spawn_coated_glass_bubble_sphere(
147147
fn spawn_golf_ball(commands: &mut Commands, asset_server: &AssetServer) {
148148
commands.spawn((
149149
SceneRoot(
150-
asset_server.load(GltfAssetLabel::Scene(0).from_asset("models/GolfBall/GolfBall.glb")),
150+
asset_server.load(GltfSubassetName::Scene(0).from_asset("models/GolfBall/GolfBall.glb")),
151151
),
152152
Transform::from_xyz(1.0, 1.0, 0.0).with_scale(Vec3::splat(SPHERE_SCALE)),
153153
ExampleSphere,

examples/3d/color_grading.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,14 +344,14 @@ fn add_camera(commands: &mut Commands, asset_server: &AssetServer, color_grading
344344
fn add_basic_scene(commands: &mut Commands, asset_server: &AssetServer) {
345345
// Spawn the main scene.
346346
commands.spawn(SceneRoot(asset_server.load(
347-
GltfAssetLabel::Scene(0).from_asset("models/TonemappingTest/TonemappingTest.gltf"),
347+
GltfSubassetName::Scene(0).from_asset("models/TonemappingTest/TonemappingTest.gltf"),
348348
)));
349349

350350
// Spawn the flight helmet.
351351
commands.spawn((
352352
SceneRoot(
353353
asset_server
354-
.load(GltfAssetLabel::Scene(0).from_asset("models/FlightHelmet/FlightHelmet.gltf")),
354+
.load(GltfSubassetName::Scene(0).from_asset("models/FlightHelmet/FlightHelmet.gltf")),
355355
),
356356
Transform::from_xyz(0.5, 0.0, -0.5).with_rotation(Quat::from_rotation_y(-0.15 * PI)),
357357
));

examples/3d/contact_shadows.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
183183
commands
184184
.spawn((
185185
SceneRoot(asset_server.load(
186-
GltfAssetLabel::Scene(0).from_asset("models/FlightHelmet/FlightHelmet.gltf"),
186+
GltfSubassetName::Scene(0).from_asset("models/FlightHelmet/FlightHelmet.gltf"),
187187
)),
188188
Transform::from_rotation(Quat::from_rotation_y(std::f32::consts::PI)),
189189
))

examples/3d/deferred_rendering.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ fn setup(
7474

7575
// FlightHelmet
7676
let helmet_scene = asset_server
77-
.load(GltfAssetLabel::Scene(0).from_asset("models/FlightHelmet/FlightHelmet.gltf"));
77+
.load(GltfSubassetName::Scene(0).from_asset("models/FlightHelmet/FlightHelmet.gltf"));
7878

7979
commands.spawn(SceneRoot(helmet_scene.clone()));
8080
commands.spawn((

examples/3d/depth_of_field.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>, app_settings: R
8585

8686
// Spawn the scene.
8787
commands.spawn(SceneRoot(asset_server.load(
88-
GltfAssetLabel::Scene(0).from_asset("models/DepthOfFieldExample/DepthOfFieldExample.glb"),
88+
GltfSubassetName::Scene(0).from_asset("models/DepthOfFieldExample/DepthOfFieldExample.glb"),
8989
)));
9090

9191
// Spawn the help text.

examples/3d/irradiance_volumes.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -484,16 +484,16 @@ fn handle_mouse_clicks(
484484
impl FromWorld for ExampleAssets {
485485
fn from_world(world: &mut World) -> Self {
486486
let fox_animation =
487-
world.load_asset(GltfAssetLabel::Animation(1).from_asset("models/animated/Fox.glb"));
487+
world.load_asset(GltfSubassetName::Animation(1).from_asset("models/animated/Fox.glb"));
488488
let (fox_animation_graph, fox_animation_node) =
489489
AnimationGraph::from_clip(fox_animation.clone());
490490

491491
ExampleAssets {
492492
main_sphere: world.add_asset(Sphere::default().mesh().uv(32, 18)),
493-
fox: world.load_asset(GltfAssetLabel::Scene(0).from_asset("models/animated/Fox.glb")),
493+
fox: world.load_asset(GltfSubassetName::Scene(0).from_asset("models/animated/Fox.glb")),
494494
main_sphere_material: world.add_asset(Color::from(SILVER)),
495495
main_scene: world.load_asset(
496-
GltfAssetLabel::Scene(0)
496+
GltfSubassetName::Scene(0)
497497
.from_asset("models/IrradianceVolumeExample/IrradianceVolumeExample.glb"),
498498
),
499499
irradiance_volume: world.load_asset("irradiance_volumes/Example.vxgi.ktx2"),

examples/3d/light_textures.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ fn spawn_light_textures(
254254
Selection::PointLight,
255255
children![
256256
SceneRoot(
257-
asset_server.load(GltfAssetLabel::Scene(0).from_asset("models/Faces/faces.glb")),
257+
asset_server.load(GltfSubassetName::Scene(0).from_asset("models/Faces/faces.glb")),
258258
),
259259
(
260260
Mesh3d(meshes.add(Sphere::new(1.0))),

0 commit comments

Comments
 (0)