Skip to content

Commit 5e69518

Browse files
pcwaltonmockersf
andauthored
Don't restrict the scene viewer to loading assets from approved paths. (#18828)
The purpose of the scene viewer is to load arbitrary glTF scenes, so it's inconvenient if they have to be moved into the Bevy assets directory first. Thus this patch switches the scene viewer to use `UnapprovedPathMode::Allow`. --------- Co-authored-by: François Mockers <[email protected]>
1 parent 47f46b5 commit 5e69518

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

examples/tools/scene_viewer/main.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
1111
use argh::FromArgs;
1212
use bevy::{
13+
asset::UnapprovedPathMode,
1314
core_pipeline::prepass::{DeferredPrepass, DepthPrepass},
1415
pbr::DefaultOpaqueRendererMethod,
1516
prelude::*,
@@ -74,6 +75,8 @@ fn main() {
7475
})
7576
.set(AssetPlugin {
7677
file_path: std::env::var("CARGO_MANIFEST_DIR").unwrap_or_else(|_| ".".to_string()),
78+
// Allow scenes to be loaded from anywhere on disk
79+
unapproved_path_mode: UnapprovedPathMode::Allow,
7780
..default()
7881
}),
7982
CameraControllerPlugin,

0 commit comments

Comments
 (0)