Skip to content

armgit / raea

Public Imported from GitHub
0

Render Anything Engine: tell your AI what to make. Videos, motion graphics, 3D and games as React and TypeScript, rendered on your own GPU. Rust + Bevy, macOS, Linux and Windows.

Stills of a 2D composition render into a folder that doesn't exist yet, as before DR2

James Dimachkie22cac9cf13b9
diff --git a/runtime/export/src/lib.rs b/runtime/export/src/lib.rs
index a961bcdd..e7fdd4ce 100644
--- a/runtime/export/src/lib.rs
+++ b/runtime/export/src/lib.rs
@@ -67,11 +67,11 @@ pub(crate) struct Sound {
/// `render --manifest PATH` (the CLI's; render_bundle keeps its signature for the iPhone): where render.json goes.
static MANIFEST: std::sync::Mutex<Option<PathBuf>> = std::sync::Mutex::new(None);
-/// With --manifest, its file: the frames' boxes as drawn (Ctx.manifest), its findings (DR3) and the sounds heard.
+/// The manifest, its folder made first (2D stills write it before their frames): boxes as drawn, findings, sounds.
fn write_manifest(cx: &mut Ctx, (w, h, fps): (u32, u32, f64), found: Vec<raea_core_facts::Finding>, heard: impl FnOnce(&Ctx) -> Value) -> R<()> {
let (Some(path), Some(frames)) = (MANIFEST.lock().unwrap().clone(), cx.manifest.take()) else { return Ok(()) };
- let m = json!({"width": w, "height": h, "fps": fps, "frames": frames, "findings": raea_core_facts::finding::ranked(found), "sounds": heard(cx), "not_applied": not_applied::seen(), "layers": raea_sys_layers::finish(fps)});
- std::fs::write(&path, m.to_string()).map_err(|e| format!("{}: {e}", path.display()))
+ let m = json!({"width": w, "height": h, "fps": fps, "frames": frames, "findings": raea_core_facts::finding::ranked(found), "sounds": heard(cx), "not_applied": not_applied::seen(), "layers": raea_sys_layers::finish(fps)}).to_string();
+ path.parent().map_or(Ok(()), std::fs::create_dir_all).and_then(|()| std::fs::write(&path, m)).map_err(|e| format!("{}: {e}", path.display()))
}
/// `render --stage WxH`: a responsive composition (one that lays out from useVideoConfig) laid out at a stage's size, as