Import: missing sequence frames show a placeholder, as in After Effects (#297)
After Effects shows a missing frame of an image sequence as a placeholder (colour bars) and has no Hold Previous Frame or Skip choice in Interpret Footage, so EffectCraft doesn't either. Interpret Footage loses its Missing Frames field, file.interpretFootage its missingFrames parameter, and Footage its missing_frames setting. A gap in a numbered sequence's numbering always shows colour bars. A sequence imported with Force Alphabetical Order still plays its files one after another (its numbering doesn't count), as in After Effects; that is now an internal Footage.alphabetical flag, set on import and kept by Reload. The Interpret Footage note lists the missing frames. Projects saved before this have no such field and open with the After Effects behaviour: a sequence with gaps shows placeholders where it used to close them up. Test: project sequence unit tests (placeholders, alphabetical order, projects saved without the flag), tests_sequence (Start Frame instead of Hold / Skip), sequence_gaps_show_placeholders (media) and the Interpret Footage fields in ui_drag_drop. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
50c9549529
commit
efd348335f
@@ -523,7 +523,7 @@ impl Inner {
|
||||
let i = Self::frame_index(footage.frame_rate, t, footage.sequence_frames(), footage.loop_count);
|
||||
match footage.sequence_file(i) {
|
||||
Some(path) => Loc { key: key(path, 0), media_t: None },
|
||||
// A gap in the numbering (Missing Frames ▸ Show Placeholder).
|
||||
// A gap in the numbering: colour bars, as in After Effects.
|
||||
None => Loc { key: key(PLACEHOLDER, ((footage.width as i64) << 32) | footage.height as i64), media_t: None },
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ use std::sync::Arc;
|
||||
use std::time::Instant;
|
||||
|
||||
use effectcraft_media::{MediaPool, probe};
|
||||
use effectcraft_project::{AlphaMode, Footage, FootageKind, ItemId, MissingFrames};
|
||||
use effectcraft_project::{AlphaMode, Footage, FootageKind, ItemId};
|
||||
use effectcraft_raster::Image;
|
||||
use effectcraft_render::FootageSource;
|
||||
use effectcraft_time::{FrameRate, TICKS_PER_SECOND, Tick};
|
||||
@@ -379,10 +379,10 @@ fn png_sequence_import() {
|
||||
assert_eq!(*img, load_png(&first.with_file_name("seq_0004.png")));
|
||||
}
|
||||
|
||||
/// A gap in a sequence's numbering shows colour bars (Missing Frames ▸ Show Placeholder), the
|
||||
/// frame before it (Hold) or nothing at all (Skip: the files play back to back) (#297).
|
||||
/// A gap in a sequence's numbering shows colour bars, as in After Effects; in Force
|
||||
/// Alphabetical Order the files play back to back (#297).
|
||||
#[test]
|
||||
fn sequence_gaps_show_placeholders_hold_or_close_up() {
|
||||
fn sequence_gaps_show_placeholders() {
|
||||
let dir = fixtures().join(format!("gap-seq-{}", std::process::id()));
|
||||
std::fs::create_dir_all(&dir).expect("mkdir");
|
||||
// Frames 1, 2 and 4: frame 3 is missing. Each frame is a flat grey of its number.
|
||||
@@ -393,8 +393,7 @@ fn sequence_gaps_show_placeholders_hold_or_close_up() {
|
||||
grey(n).save(&p).expect("write png");
|
||||
files.push(p.to_string_lossy().to_string());
|
||||
}
|
||||
let mut f =
|
||||
Footage { kind: FootageKind::Sequence, sequence: files, missing_frames: MissingFrames::Placeholder, ..probe(dir.join("gap_001.png")).expect("probe") };
|
||||
let mut f = Footage { kind: FootageKind::Sequence, sequence: files, ..probe(dir.join("gap_001.png")).expect("probe") };
|
||||
f.sync_sequence_duration();
|
||||
assert_eq!(f.duration, f.frame_rate.tick_of(4), "frames 1-4");
|
||||
let pool = MediaPool::new();
|
||||
@@ -407,9 +406,7 @@ fn sequence_gaps_show_placeholders_hold_or_close_up() {
|
||||
assert_eq!(bars.get(0, 0), [0.75, 0.75, 0.75, 1.0]);
|
||||
assert_eq!(bars.get(7, 3), [0.0, 0.0, 0.75, 1.0], "blue on the right");
|
||||
assert_eq!(level(&at(&f, 3)), 200);
|
||||
f.missing_frames = MissingFrames::Hold;
|
||||
assert_eq!(level(&at(&f, 2)), 100, "holds frame 2");
|
||||
f.missing_frames = MissingFrames::Skip;
|
||||
f.alphabetical = true;
|
||||
f.sync_sequence_duration();
|
||||
assert_eq!(f.duration, f.frame_rate.tick_of(3));
|
||||
assert_eq!(level(&at(&f, 2)), 200, "frame 4 follows frame 2");
|
||||
|
||||
Reference in New Issue
Block a user