Import: Interpret Footage has Start Timecode, as in After Effects (#297)
After Effects' Interpret Footage has Start Timecode: Use Source File Timecode, or Override Start, which changes the timecode the footage shows and leaves its frames alone. The Start Frame field that trimmed or padded a sequence's head isn't in After Effects, so it is replaced. Footage.start_timecode (Override Start, in frames at the footage's rate; None = Use Source, 0 as file timecode isn't read) relabels source time: the Footage panel's current time and footage.info's `timecode` count from it. file.interpretFootage takes `overrideStart` and `startTimecode` (timecode, read at the footage's rate after any frame rate change, or a frame number, 0 to 1e9). It applies to every footage with time, not only sequences, and Reload keeps it. A sequence's frames always run from its first file's number to its last. Test: start_timecode_only_relabels_source_time (project), interpret_footage_start_timecode_relabels_source_time (engine: the reply, the Footage panel's timecode, frame numbers, Use Source, the footage's rate, bad values, undo), Reload keeps it, 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
e12bf5ca7d
commit
a34aecd719
@@ -115,7 +115,7 @@ pub fn show(app: &mut EffectcraftApp, ui: &mut egui::Ui, rect: Rect) {
|
||||
p.text(
|
||||
pos2(x, bar.center().y),
|
||||
Align2::LEFT_CENTER,
|
||||
effectcraft_engine::time::format_timecode_ae(fr.frame_at(view.time), fr, false),
|
||||
effectcraft_engine::commands::footage_panel::timecode(Some(&item), fr, fr.frame_at(view.time)),
|
||||
Tokens::mono(12.0),
|
||||
t.timecode,
|
||||
);
|
||||
|
||||
@@ -447,23 +447,28 @@ pub fn open_form(app: &mut EffectcraftApp, id: &str, p: &Value) -> bool {
|
||||
),
|
||||
Field::bool("linearLight", "Interpret As Linear Light", f.linear_light),
|
||||
];
|
||||
// Image sequences: their frames (missing ones show colour bars, as in After Effects)
|
||||
// and the first frame's number.
|
||||
// After Frame Rate: an image sequence's frames (missing ones show colour bars, as in
|
||||
// After Effects), then Start Timecode.
|
||||
let mut timing = Vec::new();
|
||||
if f.kind == effectcraft_engine::project::FootageKind::Sequence {
|
||||
let at = fields.iter().position(|x| x.key == "frameRate").map_or(fields.len(), |i| i + 1);
|
||||
let gaps = match effectcraft_engine::sequence::missing_report(&f.sequence) {
|
||||
_ if f.alphabetical => "files in alphabetical order".into(),
|
||||
Some(gaps) => format!("{gaps} shown as color bars"),
|
||||
None => "no missing frames".into(),
|
||||
};
|
||||
fields.splice(
|
||||
at..at,
|
||||
[
|
||||
Field::note("sequenceInfo", &format!("Image sequence: {} files, {} frames; {gaps}.", f.sequence.len(), f.sequence_frames())),
|
||||
Field::num("startFrame", "Start Frame", f.first_frame_number() as f64),
|
||||
],
|
||||
);
|
||||
timing.push(Field::note("sequenceInfo", &format!("Image sequence: {} files, {} frames; {gaps}.", f.sequence.len(), f.sequence_frames())));
|
||||
}
|
||||
if f.kind != effectcraft_engine::project::FootageKind::Still {
|
||||
timing.push(Field::choice(
|
||||
"overrideStart",
|
||||
"Start Timecode",
|
||||
&[("Use Source File Timecode", json!(false)), ("Override Start", json!(true))],
|
||||
usize::from(f.start_timecode.is_some()),
|
||||
));
|
||||
timing.push(Field::text("startTimecode", "Override Start", &f.timecode(0)));
|
||||
}
|
||||
let at = fields.iter().position(|x| x.key == "frameRate").map_or(fields.len(), |i| i + 1);
|
||||
fields.splice(at..at, timing);
|
||||
(if proxy { "Interpret Footage: Proxy".into() } else { "Interpret Footage".into() }, fields)
|
||||
}
|
||||
"file.projectSettings" if p.as_object().is_none_or(|m| m.is_empty()) => {
|
||||
|
||||
Reference in New Issue
Block a user