From fba784cc29478b555a2a91620a0e5c361ae98dc8 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Sun, 13 Apr 2025 01:53:19 -0700 Subject: [PATCH 1/2] Don't restrict the scene viewer to loading assets from approved paths. 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`. --- examples/tools/scene_viewer/main.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/tools/scene_viewer/main.rs b/examples/tools/scene_viewer/main.rs index 0266a22ee0a06..07aa046756680 100644 --- a/examples/tools/scene_viewer/main.rs +++ b/examples/tools/scene_viewer/main.rs @@ -10,6 +10,7 @@ use argh::FromArgs; use bevy::{ + asset::UnapprovedPathMode, core_pipeline::prepass::{DeferredPrepass, DepthPrepass}, pbr::DefaultOpaqueRendererMethod, prelude::*, @@ -74,6 +75,9 @@ fn main() { }) .set(AssetPlugin { file_path: std::env::var("CARGO_MANIFEST_DIR").unwrap_or_else(|_| ".".to_string()), + // Allow scenes to be loaded from anywhere on disk, as that's + // the entire point of this program. + unapproved_path_mode: UnapprovedPathMode::Allow, ..default() }), CameraControllerPlugin, From a75946ed02c0c9c842cc7a573b845c54c260d9a0 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Sun, 13 Apr 2025 10:55:03 -0700 Subject: [PATCH 2/2] Update examples/tools/scene_viewer/main.rs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: François Mockers --- examples/tools/scene_viewer/main.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/tools/scene_viewer/main.rs b/examples/tools/scene_viewer/main.rs index 07aa046756680..f5ab505d91520 100644 --- a/examples/tools/scene_viewer/main.rs +++ b/examples/tools/scene_viewer/main.rs @@ -75,8 +75,7 @@ fn main() { }) .set(AssetPlugin { file_path: std::env::var("CARGO_MANIFEST_DIR").unwrap_or_else(|_| ".".to_string()), - // Allow scenes to be loaded from anywhere on disk, as that's - // the entire point of this program. + // Allow scenes to be loaded from anywhere on disk unapproved_path_mode: UnapprovedPathMode::Allow, ..default() }),