From 628dea812f3e0129d8e6027df4c7ab9856eabb58 Mon Sep 17 00:00:00 2001 From: Brooks Palin Date: Thu, 22 Feb 2024 10:14:45 -0700 Subject: [PATCH] Removed Grid and Fixed Ending Frames (#47) This PR Removes the gridlines from headless renders and Removes useless frames from the end of headless renders. Really small PR. Let me know what you think! --- studio/src/lib.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/studio/src/lib.rs b/studio/src/lib.rs index 1ea4816..62ee32d 100644 --- a/studio/src/lib.rs +++ b/studio/src/lib.rs @@ -313,7 +313,7 @@ pub fn start_headless( close_when_requested: true, }), ScreenShotPlugin, - CommonPlugins, + CommonPlugins.build().disable::(), )); match mode { @@ -326,7 +326,6 @@ pub fn start_headless( mut ew: EventWriter| { cmd.insert_resource(SkyboxId(skybox.clone())); cmd.insert_resource(TestBvh(asset_server.load(bvh_dir.clone()))); - ew.send(LoadSceneEvent("Mannequin.gltf".to_string())); }, ); @@ -377,15 +376,17 @@ impl Default for HeadlessSettings { } fn check_for_capture_complete( - main_camera: Query<&ScreenCapture, With>, + mut commands: Commands, mut close_app: EventWriter, + main_camera: Query<(Entity, &ScreenCapture), With>, bvh_event_reader: EventReader, ) { - let Ok(screen_capture) = main_camera.get_single() else { + let Ok((entity, screen_capture)) = main_camera.get_single() else { return; }; if screen_capture.is_complete() || !bvh_event_reader.is_empty() { + commands.entity(entity).remove::(); close_app.send(AppExit); } }