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!
This commit is contained in:
Brooks Palin
2024-02-22 10:14:45 -07:00
committed by GitHub
parent f1d6461393
commit 628dea812f
+5 -4
View File
@@ -313,7 +313,7 @@ pub fn start_headless(
close_when_requested: true,
}),
ScreenShotPlugin,
CommonPlugins,
CommonPlugins.build().disable::<WorldGridPlugin>(),
));
match mode {
@@ -326,7 +326,6 @@ pub fn start_headless(
mut ew: EventWriter<LoadSceneEvent>| {
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<MainCamera>>,
mut commands: Commands,
mut close_app: EventWriter<AppExit>,
main_camera: Query<(Entity, &ScreenCapture), With<MainCamera>>,
bvh_event_reader: EventReader<BvhAnimCompleteEvent>,
) {
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::<ScreenCapture>();
close_app.send(AppExit);
}
}