Skip to content

FilmCraft: An open-source, nonlinear video editor written by scratch in pure Rust

Merge #2653: Stop writing an empty ref for FCPXML titles and adjustment layers (#2638)

aiongg48a6d6a08e94
diff --cc crates/interchange/src/fcpxml.rs
index c50186081,481813f4d..571ad82d0
--- a/crates/interchange/src/fcpxml.rs
+++ b/crates/interchange/src/fcpxml.rs
@@@ -960,24 -958,13 +974,13 @@@ impl Exp<'_, '_>
let rate = seq.settings.frame_rate;
let base = base_item(self.p, it.item);
let is_seq = matches!(self.p.item(base).map(|i| &i.kind), Some(ItemKind::Sequence(_)));
- let generator = generator_of(self.p, base).cloned();
let lane_attr = lane.map(|l| format!(" lane=\"{l}\"")).unwrap_or_default();
- let name = crate::xml::escape(&it.name);
+ let name = crate::xml::escape_attr(&it.name);
- if let Some(g) = generator {
- self.report.warn(format!("generator \"{}\" is not supported in FCPXML; written as a gap", g.label()));
- return El {
- start: it.start,
- end: it.end(),
- local: offset,
- xml_open: format!(
- "<gap name=\"{name}\"{lane_attr} offset=\"{}\" start=\"{}\" duration=\"{}\"",
- fmt_time(offset, rate),
- fmt_time(offset, rate),
- fmt_time(it.duration, rate)
- ),
- children: vec![],
- close: "gap".into(),
- };
+ // In the primary storyline, a clip FCPXML cannot carry becomes a gap that keeps the timing
+ // (connected ones never get here: see `unsupported`).
+ if let Some(what) = self.unsupported(it, rate) {
+ self.report.warn(format!("{what}: it is written as a gap and is not read back on import"));
+ return gap_el(it, &name, offset, rate);
}
// Local timeline of the element: origin + source time (retimed clips use a timeMap).
let (tag, r, origin) = if is_seq {