Scripting: footage proxies, replaceWithSequence and mainSource.conformFrameRate (#813)
FootageItem had no replaceWithSequence, setProxy, setProxyWithSequence or setProxyToNone, useProxy and proxySource were fixed stubs, and mainSource was a new object on every read with no conformFrameRate. They now run the existing commands (file.replaceFootage, file.setProxy, file.useProxy, file.setProxyNone, file.interpretFootage); the item info reports the proxy and the conform/native frame rates, and mainSource is one live FootageSource per FootageItem. replaceSource is not covered: it needs an engine command that changes a layer's source. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
470ea7a3af
commit
004984d853
@@ -121,6 +121,11 @@ fn item(s: &Session, a: &J) -> R {
|
||||
});
|
||||
let used_in: Vec<u64> = s.project.comps().filter(|(_, c)| c.layers.iter().any(|l| l.source.item() == Some(id))).map(|(cid, _)| cid.0).collect();
|
||||
o["usedIn"] = json!(used_in);
|
||||
// The item's proxy (footage and comps): its file and whether Use Proxy is on (#813).
|
||||
o["proxy"] = match &it.proxy {
|
||||
Some(p) => json!({"file": p.footage.path, "isStill": p.footage.kind == effectcraft_project::FootageKind::Still, "enabled": p.enabled}),
|
||||
None => J::Null,
|
||||
};
|
||||
match &it.kind {
|
||||
ItemKind::Folder => {
|
||||
o["kind"] = json!("folder");
|
||||
@@ -171,6 +176,9 @@ fn item(s: &Session, a: &J) -> R {
|
||||
o["footageMissing"] = json!(fo.missing);
|
||||
o["isStill"] = json!(fo.kind == effectcraft_project::FootageKind::Still);
|
||||
o["loop"] = json!(fo.loop_count);
|
||||
// Interpret Footage ▸ Conform to frame rate: 0 when the file's own rate is used (#813).
|
||||
o["conformFrameRate"] = json!(if fo.native_rate.is_some() { fo.frame_rate.as_f64() } else { 0.0 });
|
||||
o["nativeFrameRate"] = json!(fo.native_rate.unwrap_or(fo.frame_rate).as_f64());
|
||||
}
|
||||
ItemKind::Solid(so) => {
|
||||
o["kind"] = json!("solid");
|
||||
|
||||
Reference in New Issue
Block a user