diff --git a/runtime/export/src/lib.rs b/runtime/export/src/lib.rs index a961bcddd..b7f0954eb 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> = 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, 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())) + path.parent().map_or(Ok(()), std::fs::create_dir_all).map_err(|e| format!("{}: {e}", path.display()))?; + std::fs::write(&path, 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()).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