mirror of
https://github.com/storytold/storyteller-bevy.git
synced 2026-10-18 07:35:19 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user