From 522ded7f2ff11828023c329b274be3329d7bf8d3 Mon Sep 17 00:00:00 2001 From: Brooks Palin Date: Thu, 29 Feb 2024 21:43:45 -0700 Subject: [PATCH] ran cargo fmt --- studio/src/headless.rs | 16 +++++++++++++--- studio/src/main-headless.rs | 38 +++++++++++++++++++++---------------- studio/src/scene.rs | 3 ++- studio/src/screenshot.rs | 19 ++++++++++++++----- 4 files changed, 51 insertions(+), 25 deletions(-) diff --git a/studio/src/headless.rs b/studio/src/headless.rs index 86d2c8a..0130553 100644 --- a/studio/src/headless.rs +++ b/studio/src/headless.rs @@ -8,7 +8,11 @@ use space_editor::prelude::{EditorEvent, EditorPrefabPath}; use wgpu::Extent3d; use crate::{ - bvh::{BvhAnimCompleteEvent, TestBvh}, scene::SceneState, screenshot::{ScreenCapture, ScreenShotPlugin}, BvhPlugin, CommonPlugins, LoadLibraryObjectEvent, LoadSceneEvent, MainCamera, MixamoImportEvent, MixamoPlugin, SkyboxId, StudioMode, WorldGridPlugin + bvh::{BvhAnimCompleteEvent, TestBvh}, + scene::SceneState, + screenshot::{ScreenCapture, ScreenShotPlugin}, + BvhPlugin, CommonPlugins, LoadLibraryObjectEvent, LoadSceneEvent, MainCamera, + MixamoImportEvent, MixamoPlugin, SkyboxId, StudioMode, WorldGridPlugin, }; #[derive(Debug, Resource, Clone)] @@ -61,7 +65,10 @@ pub fn start_headless( }, ); - app.add_systems(PostUpdate, check_for_bvh_capture_complete.run_if(in_state(SceneState::Active))); + app.add_systems( + PostUpdate, + check_for_bvh_capture_complete.run_if(in_state(SceneState::Active)), + ); } HeadlessMode::Scene(scene, skybox) => { app.add_systems( @@ -84,7 +91,10 @@ pub fn start_headless( commands.insert_resource(SkyboxId(skybox.clone())); }, ); - app.add_systems(PostUpdate, check_for_mixamo_capture_complete.run_if(in_state(SceneState::Active))); + app.add_systems( + PostUpdate, + check_for_mixamo_capture_complete.run_if(in_state(SceneState::Active)), + ); app.run(); } diff --git a/studio/src/main-headless.rs b/studio/src/main-headless.rs index 1c789ed..c193025 100644 --- a/studio/src/main-headless.rs +++ b/studio/src/main-headless.rs @@ -1,4 +1,7 @@ -use bevy::{prelude::*, render::render_resource::Extent3d, transform::components::Transform, window::PrimaryWindow}; +use bevy::{ + prelude::*, render::render_resource::Extent3d, transform::components::Transform, + window::PrimaryWindow, +}; use clap::{Args, Parser, Subcommand}; use studio::headless::{start_headless, HeadlessMode}; @@ -20,7 +23,7 @@ enum Subcommands { Scene { scene_dir: String, #[arg(long)] - orbit : bool, + orbit: bool, #[arg(long, short)] output_dir: Option, #[arg(long)] @@ -92,15 +95,12 @@ fn main() { frames, output_res, ); - + if orbit { - app.insert_resource(OrbitSettings { - radius: 10.0, - }) - .add_systems(Update, orbit_scene) - ; + app.insert_resource(OrbitSettings { radius: 10.0 }) + .add_systems(Update, orbit_scene); } - + app } Subcommands::Bvh { @@ -163,14 +163,20 @@ struct OrbitSettings { radius: f32, } -fn orbit_scene ( - mut camera : Query<&mut Transform, With>, - orbit_settings : Res, - time : Res