Headless Mode fixes for the Backend (#65)

This PR brings some fixes that are needed for the backend to render
scenes.
This commit is contained in:
Brooks Palin
2024-02-29 21:47:42 -07:00
committed by GitHub
parent 3413810773
commit a2b2946678
6 changed files with 141 additions and 9 deletions
+9 -3
View File
@@ -9,6 +9,7 @@ use wgpu::Extent3d;
use crate::{
bvh::{BvhAnimCompleteEvent, TestBvh},
scene::SceneState,
screenshot::{ScreenCapture, ScreenShotPlugin},
BvhPlugin, CommonPlugins, LoadLibraryObjectEvent, LoadSceneEvent, MainCamera,
MixamoImportEvent, MixamoPlugin, SkyboxId, StudioMode, WorldGridPlugin,
@@ -64,7 +65,10 @@ pub fn start_headless(
},
);
app.add_systems(PostUpdate, check_for_bvh_capture_complete);
app.add_systems(
PostUpdate,
check_for_bvh_capture_complete.run_if(in_state(SceneState::Active)),
);
}
HeadlessMode::Scene(scene, skybox) => {
app.add_systems(
@@ -87,7 +91,10 @@ pub fn start_headless(
commands.insert_resource(SkyboxId(skybox.clone()));
},
);
app.add_systems(PostUpdate, check_for_mixamo_capture_complete);
app.add_systems(
PostUpdate,
check_for_mixamo_capture_complete.run_if(in_state(SceneState::Active)),
);
app.run();
}
@@ -135,7 +142,6 @@ fn check_for_bvh_capture_complete(
return;
};
println!("Frames captured {}", screen_capture.frames_captured());
if !screen_capture.should_capture() || !bvh_event_reader.is_empty() {
screen_capture.stop_capturing();
close_app.send(AppExit);