mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-07 02:21:23 +00:00
pass skybox option to bevy renderer
This commit is contained in:
1 parent
7d690b3584
commit
1741f5644e
4 files changed
+24
-1
No files matched your search
+4
-1
@@ -7,5 +7,8 @@ pub struct RenderEngineSceneToVideoArgs {
|
||||
#[serde(rename = "s")]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub camera_speed: Option<f32>,
|
||||
}
|
||||
|
||||
#[serde(rename = "b")]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub skybox: Option<String>,
|
||||
}
|
||||
+7
@@ -8,6 +8,7 @@ pub struct RenderEngineSceneToVideoCommandArgs<'a> {
|
||||
pub output_directory: &'a Path,
|
||||
pub maybe_camera: Option<&'a str>,
|
||||
pub maybe_camera_speed: Option<f32>,
|
||||
pub maybe_skybox: Option<&'a str>,
|
||||
}
|
||||
|
||||
impl CommandArgs for RenderEngineSceneToVideoCommandArgs<'_> {
|
||||
@@ -32,6 +33,12 @@ impl CommandArgs for RenderEngineSceneToVideoCommandArgs<'_> {
|
||||
command.push_str(" ");
|
||||
}
|
||||
|
||||
if let Some(skybox) = self.maybe_skybox {
|
||||
command.push_str(" -b ");
|
||||
command.push_str(skybox);
|
||||
command.push_str(" ");
|
||||
}
|
||||
|
||||
command
|
||||
}
|
||||
}
|
||||
+3
@@ -120,10 +120,12 @@ pub async fn process_job(args: BvhToWorkflowJobArgs<'_>) -> Result<JobSuccessRes
|
||||
|
||||
let mut maybe_camera = None;
|
||||
let mut maybe_camera_speed = None;
|
||||
let mut maybe_skybox = None;
|
||||
|
||||
if let Some(engine_args) = maybe_args {
|
||||
maybe_camera = engine_args.camera_animation.clone();
|
||||
maybe_camera_speed = engine_args.camera_speed.clone();
|
||||
maybe_skybox = engine_args.skybox.clone();
|
||||
}
|
||||
|
||||
// ==================== RUN INFERENCE SCRIPT ==================== //
|
||||
@@ -143,6 +145,7 @@ pub async fn process_job(args: BvhToWorkflowJobArgs<'_>) -> Result<JobSuccessRes
|
||||
output_directory: &output_directory,
|
||||
maybe_camera: maybe_camera.as_deref(),
|
||||
maybe_camera_speed,
|
||||
maybe_skybox: maybe_skybox.as_deref(),
|
||||
}),
|
||||
//maybe_stderr_output_file: Some(FileOrCreate::NewFileWithName(&stderr_output_file)),
|
||||
// NB(bt,2024-02-29): Bevy's stdout goes to stderr, so we can't capture the semantics we want
|
||||
|
||||
+10
@@ -56,6 +56,9 @@ pub struct EnqueueBvhToWorkflowRequest {
|
||||
|
||||
/// A camera speed (optional)
|
||||
camera_speed: Option<f32>,
|
||||
|
||||
/// A skybox color or name (optional)
|
||||
skybox: Option<String>,
|
||||
}
|
||||
|
||||
|
||||
@@ -235,6 +238,13 @@ pub async fn enqueue_render_engine_scene_to_video_handler(
|
||||
maybe_args = Some(args);
|
||||
}
|
||||
|
||||
if let Some(skybox) = request.skybox.as_deref() {
|
||||
let mut args = maybe_args
|
||||
.unwrap_or(RenderEngineSceneToVideoArgs::default());
|
||||
args.skybox = Some(skybox.to_string());
|
||||
maybe_args = Some(args);
|
||||
}
|
||||
|
||||
let maybe_args = maybe_args.map(|args| PolymorphicInferenceArgs::Es(args));
|
||||
|
||||
let query_result = insert_generic_inference_job(InsertGenericInferenceArgs {
|
||||
|
||||
Reference in new issue
Block a user