mirror of
https://github.com/storytold/effectcraft.git
synced 2026-10-31 05:27:08 -06:00
M13.15: qa scenarios 1-4 (kinetic type, shape logo, compositing, tracking) and fixes
engine.batch + MCP batch tool; layer.newText/newShape name; prop.get evaluated expression value; keys.select by path with errors; @uid paths; plain-JSON gradients; addShapeItem/effect.apply return paths; unknown layers error; conform rescales footage duration; render log name for [###]; render_frame transparent; clearer mask errors; truncated groups in flat get_layer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
95766755f3
commit
fecf054e5f
@@ -307,6 +307,11 @@ pub enum Seg {
|
||||
|
||||
/// Parse `transform/position`, `effects/#1/blurriness`, `effects/@57/blurriness`,
|
||||
/// `contents/rect#2/size`.
|
||||
/// `@57` (a whole path that is one uid).
|
||||
fn bare_uid(path: &str) -> Option<Uid> {
|
||||
path.trim().strip_prefix('@')?.parse().ok()
|
||||
}
|
||||
|
||||
pub fn parse_path(s: &str) -> Vec<Seg> {
|
||||
s.split(['/', '.'])
|
||||
.filter(|x| !x.is_empty())
|
||||
@@ -365,10 +370,17 @@ impl PropGroup {
|
||||
let i = g.child_index(last)?;
|
||||
g.children.get_mut(i)
|
||||
}
|
||||
/// A property by path; a bare `@uid` finds the property anywhere below this group.
|
||||
pub fn prop(&self, path: &str) -> Option<&Property> {
|
||||
if let Some(u) = bare_uid(path) {
|
||||
return self.find(u);
|
||||
}
|
||||
self.node(path)?.as_prop()
|
||||
}
|
||||
pub fn prop_mut(&mut self, path: &str) -> Option<&mut Property> {
|
||||
if let Some(u) = bare_uid(path) {
|
||||
return self.find_mut(u);
|
||||
}
|
||||
match self.node_mut(path)? {
|
||||
Node::Prop(p) => Some(p),
|
||||
_ => None,
|
||||
|
||||
@@ -1277,10 +1277,12 @@ impl RenderLog {
|
||||
pub fn log_path(output: &str) -> String {
|
||||
let p = std::path::Path::new(output);
|
||||
let stem = p.file_stem().map(|s| s.to_string_lossy().to_string()).unwrap_or_default();
|
||||
let mut stem: String = stem.replace("_[#####]", "").replace("[#####]", "");
|
||||
let mut stem = stem;
|
||||
if let Some(i) = stem.find('#') {
|
||||
// The run of `#`s, with its brackets when it has them (`[###]`, `[#####]`).
|
||||
let n = stem[i..].chars().take_while(|c| *c == '#').count();
|
||||
stem.replace_range(i..i + n, "");
|
||||
let (a, b) = if stem[..i].ends_with('[') && stem[i + n..].starts_with(']') { (i - 1, i + n + 1) } else { (i, i + n) };
|
||||
stem.replace_range(a..b, "");
|
||||
}
|
||||
let stem = stem.trim_end_matches(['_', '.', ' ']);
|
||||
let name = format!("{}_RenderLog.txt", if stem.is_empty() { "Render" } else { stem });
|
||||
@@ -1529,6 +1531,7 @@ mod tests {
|
||||
assert_eq!(log_path("/out/Main_[#####].png"), "/out/Main_RenderLog.txt");
|
||||
assert_eq!(log_path("/out/a.mov"), "/out/a_RenderLog.txt");
|
||||
assert_eq!(log_path("seq###.tif"), "seq_RenderLog.txt");
|
||||
assert_eq!(log_path("gen/g_[###].png"), "gen/g_RenderLog.txt", "any bracketed run (M13.15)");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user