mirror of
https://github.com/storytold/effectcraft.git
synced 2026-11-02 14:38:21 -06:00
#1830: require exporter support before skipping duplicate frames
This commit is contained in:
@@ -494,7 +494,8 @@ impl Session {
|
||||
} else {
|
||||
Target::file(Path::new(path), by_identity)
|
||||
};
|
||||
Write { item: m.id, path: path.to_string(), target, skips: m.settings.skip_existing }
|
||||
let skips = m.settings.skip_existing && self.exporter.as_ref().is_some_and(|exporter| exporter.supports_skip_existing());
|
||||
Write { item: m.id, path: path.to_string(), target, skips }
|
||||
}
|
||||
|
||||
/// The report of `later` writing over `clash`.
|
||||
|
||||
@@ -57,6 +57,11 @@ pub struct ExportResult {
|
||||
pub trait Exporter: Send + Sync {
|
||||
/// Formats this build can write.
|
||||
fn formats(&self) -> Vec<OutputFormat>;
|
||||
/// Whether Skip Existing Files preserves sequence frames written by earlier items. Exporters
|
||||
/// without an existence check (such as memory sinks) must keep the conservative default.
|
||||
fn supports_skip_existing(&self) -> bool {
|
||||
false
|
||||
}
|
||||
/// Render and write one item (blocking). `progress(done, total)` returns `false` to cancel;
|
||||
/// a cancelled export removes the files it opened for that output and returns `Err("cancelled")`.
|
||||
/// Completed earlier queue items and unrelated files must be preserved.
|
||||
|
||||
@@ -28,6 +28,9 @@ impl Exporter for Writer {
|
||||
fn formats(&self) -> Vec<OutputFormat> {
|
||||
OutputFormat::ALL.to_vec()
|
||||
}
|
||||
fn supports_skip_existing(&self) -> bool {
|
||||
true
|
||||
}
|
||||
fn export(&self, job: &ExportJob, _: &mut dyn FnMut(u64, u64) -> bool) -> Result<ExportResult, String> {
|
||||
self.jobs.lock().unwrap().push(job.path.to_string());
|
||||
let comp = job.project.comp(job.item.comp).ok_or("no comp")?;
|
||||
|
||||
Reference in New Issue
Block a user