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.
TypeScript 3dagent-skillsai-agentsai-videobevyclaude-codegame-enginegpulinuxmacosmotion-designmotion-graphicsreactrusttypescriptvideo-editingvideo-renderingwgpuwindows
MK25: a rotated CTA, cta.also
shinyobjectz0649788f7f7f
diff --git a/core/brief/src/cut.rs b/core/brief/src/cut.rsindex fdb3a54c..aa904ed8 100644--- a/core/brief/src/cut.rs+++ b/core/brief/src/cut.rs@@ -93,6 +93,10 @@ pub struct Phrase {pub struct Cta {pub text: String,pub from: String,+ /// the other lines a brief rotates (two host lines, a paid take's): any one lands it, each found in the brief+ #[serde(default)]+ #[ts(as = "Option<Vec<String>>", optional)]+ pub also: Vec<String>,/// how near the end it must land, in seconds (8 when left out)pub within: Option<f64>,}@@ -151,6 +155,9 @@ pub fn quotes(c: &Cut) -> Vec<(String, &str)> {}if let Some(cta) = &c.cta {q.push(("cta".into(), &cta.from));+ for line in &cta.also {+ q.push((format!("cta \"{line}\""), line));+ }}for o in &c.open {q.push((format!("open \"{}\"", o.question), &o.from));diff --git a/docs/make.feature b/docs/make.featureindex aa5ce9aa..d3cf8ecd 100644--- a/docs/make.feature+++ b/docs/make.feature@@ -260,7 +260,8 @@ Feature: Make: scenes, kits and shots built to a frozen plan and held to a revieThen core/brief reads `cut` (cut.rs): `brief` (that text), `count` (how many cuts the brief asks for), `seconds`and `formats`, each cut (id, angle, solo or mashup, hook, captions or a text hook, its own formats and length),`say` (phrases every cut says or shows, or one cut with `every: false`), `never` (phrases no cut says or- shows), `cta` (the line every cut ends on, within its last 8 s) and `open` (the brief's [TO CONFIRM] items)+ shows), `cta` (the line every cut ends on, within its last 8 s; `also`: the other lines a brief rotates, any+ one of which lands it, each found in the brief) and `open` (the brief's [TO CONFIRM] items)And every rule has `from`: the brief's own words for itAnd each cut lands at a fixed path, out/cuts/<id>_<W>x<H>.mp4 for each of its formatsAnd `doctor` names what the contract still lacks: no count, no cta, an id that isn't [a-z0-9_], a format thatdiff --git a/runtime/cut-plan/src/lib.rs b/runtime/cut-plan/src/lib.rsindex 41779fdb..617e9bcc 100644--- a/runtime/cut-plan/src/lib.rs+++ b/runtime/cut-plan/src/lib.rs@@ -183,17 +183,24 @@ fn file_gates(c: &Cut, plan: &cut::CutPlan, format: &str, f: &Path, rel: &str, sif let Some(cta) = &c.cta {let within = cta.within.unwrap_or(cut::CTA_WITHIN);let end = shape.map(|s| s.2).or_else(|| words.last().map(|w| w.2)).unwrap_or(0.0);- let want_s = norm(&cta.text);- let want: Vec<&str> = want_s.split(' ').collect();- let share = |got: &[&str]| {+ let last: Vec<&str> = words.iter().filter(|w| w.2 >= end - within).map(|w| w.0.as_str()).collect();+ // the share of a line's words, in order, in `got`; the best of the brief's lines+ let share = |line: &str, got: &[&str]| {+ let want_s = norm(line);+ let want: Vec<&str> = want_s.split(' ').collect();let j = joined(got, &want);in_order(&want, &j.iter().map(|(w, _)| w.as_str()).collect::<Vec<_>>())};- let last: Vec<&str> = words.iter().filter(|w| w.2 >= end - within).map(|w| w.0.as_str()).collect();- let heard_share = share(&last);- let on_screen = screen.iter().any(|(s, at)| *at >= end - within && share(&s.split(' ').collect::<Vec<_>>()) >= CTA_SHARE);+ let lines: Vec<&str> = std::iter::once(cta.text.as_str()).chain(cta.also.iter().map(String::as_str)).collect();+ let (best, heard_share) = lines.iter().map(|l| (*l, share(l, &last))).fold(("", 0.0), |a, b| if b.1 > a.1 { b } else { a });+ let on_screen = screen.iter().any(|(s, at)| *at >= end - within && lines.iter().any(|l| share(l, &s.split(' ').collect::<Vec<_>>()) >= CTA_SHARE));let ok = heard_share >= CTA_SHARE || on_screen;- out.push(gate("cta", Some(rel), ok, if ok { format!("ends on the CTA ({})", if on_screen { "on screen" } else { "heard" }) } else { format!("the CTA isn't in its last {within:.0} s ({:.0}% of its words heard there): \"{}\"", heard_share * 100.0, cta.text) }));+ let says = match (ok, on_screen) {+ (true, true) => "ends on the CTA (on screen)".to_string(),+ (true, false) => format!("ends on the CTA (heard: \"{best}\")"),+ _ => format!("no CTA in its last {within:.0} s ({:.0}% of the nearest one's words heard there): \"{}\"", heard_share * 100.0, if best.is_empty() { &cta.text } else { best }),+ };+ out.push(gate("cta", Some(rel), ok, says));}}}diff --git a/runtime/cut-plan/src/tests.rs b/runtime/cut-plan/src/tests.rsindex dc8d9fa0..c1a624f6 100644--- a/runtime/cut-plan/src/tests.rs+++ b/runtime/cut-plan/src/tests.rs@@ -180,3 +180,20 @@ fn heard_the_way_people_say_it() {deliver(&d, S1, &line.replace("It's free it's fun", "It's fun it's free"), &[]);assert!(!of(&run(&m, &d), "say", S1).clear);}++#[test]+fn a_rotated_cta_lands_on_any_of_its_lines() {+ // Dutch's hosts rotate "See a vet today at Dutch.com." and "Download the Dutch app and book a call for your dog or cat."+ let brief = format!("{BRIEF}\"See a vet today at Dutch.com.\"\n");+ let d = dir("rotated");+ put(&d, "media/brief.txt", brief.as_bytes());+ let mut m = contract("");+ m.cut.as_mut().unwrap().cta.as_mut().unwrap().also = vec!["See a vet today at Dutch.com.".into()];+ deliver(&d, S1, "it draws the names it's free fun and easy so See a vet today at Dutch com", &[]);+ let g = run(&m, &d);+ assert!(of(&g, "cta", S1).clear, "{:?}", of(&g, "cta", S1));+ assert!(named(&g, "quotes")[0].clear, "{:?}", named(&g, "quotes"));+ // a rotated line the brief doesn't have is held like any other rule+ m.cut.as_mut().unwrap().cta.as_mut().unwrap().also.push("Book now at Dutch.com".into());+ assert!(!named(&run(&m, &d), "quotes")[0].clear);+}diff --git a/sdk/raea/src/brief.gen.ts b/sdk/raea/src/brief.gen.tsindex 59fe093a..3f4e8e8b 100644--- a/sdk/raea/src/brief.gen.ts+++ b/sdk/raea/src/brief.gen.ts@@ -407,6 +407,10 @@ text: string, from: string,every?: boolean, };export type MakeCta = { text: string, from: string,+/**+ * the other lines a brief rotates (two host lines, a paid take's): any one lands it, each found in the brief+ */+also?: Array<string>,/*** how near the end it must land, in seconds (8 when left out)*/