Adding Mixamo Animations to Studio Headless (#50)

This PR adds the ability to render out mixamo animations from the
headless mode. In addition to that, there were some bugs that have been
managed and some readability changes. Let me know if you have any
questions!
This commit is contained in:
Brooks Palin
2024-02-23 14:18:20 -07:00
committed by GitHub
parent bc975779d7
commit 3258292980
4 changed files with 151 additions and 50 deletions
+13 -5
View File
@@ -48,7 +48,12 @@ impl Plugin for ScenePlugin {
.add_systems(Update, init_scene_loading.in_set(SceneSpawnerSystem))
.add_systems(
OnEnter(SceneState::Active),
(tag_scene_elements, frame_scene_in_view).in_set(SceneSpawnerSystem),
(
tag_scene_elements,
frame_scene_in_view,
start_capture.run_if(is_headless),
)
.in_set(SceneSpawnerSystem),
);
app.add_systems(Update, tag_scene_elements);
@@ -261,10 +266,7 @@ fn initialiaze_headless(
..default()
},
CameraControllerBundle::new(focus, camera_xform.translation),
ScreenCapture::number_of_frames(
headless_settings.frames_to_capture,
&headless_settings.output_dir,
),
ScreenCapture::from_out(&headless_settings.output_dir),
));
}
@@ -429,6 +431,12 @@ fn frame_scene_in_view(
cam_xform.translation = cam.focus + cam_xform.back() * radius;
}
fn start_capture(mut captures: Query<&mut ScreenCapture>) {
for mut capture in captures.iter_mut() {
capture.start_capturing();
}
}
#[cfg(feature = "wasm")]
mod wasm {
use bevy::{prelude::*, window::PrimaryWindow};