revert(pipeline): back out picture-lock trimming from the preview build
Deploy / deploy (push) Successful in 6m19s

Production fallout after enabling it: the trimmed EXR footage started
after the head handle as intended, but the overlay's burn-in timecode
(hardcoded to start at frame 1001) did not shift with it, so the
delivered burn-in no longer matched the footage. The picture-lock
reference render also never worked correctly in practice. Reverts the
AE panel checkbox, the preview-build script's trim/reference logic, and
the server/worker plumbing around it back to their pre-feature state
(82dfaee) — untrimmed previews, no picture-lock reference, overlay
timecode correct again.

The noPictureLock/piclockRefKey schema columns and their migration are
deliberately left in place: they're already applied in production, and
dropping an applied migration's file risks the next `prisma migrate
deploy`. They sit unused and harmless until this is revisited.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
twotalesanimation
2026-08-23 21:44:45 +02:00
parent 67d8639861
commit a18dfc6203
12 changed files with 21 additions and 341 deletions
+2 -43
View File
@@ -32,18 +32,6 @@ export interface PreviewManifest {
mp4Output: string;
slateScopeProp: string;
slateSubmissionProp: string;
/** Skip picture-lock trimming and the reference render entirely (§9, picture lock). */
noPictureLock: boolean;
/** `{footageRoot}/{showId}/_PICLOCKS`, mirroring the panel's getShowFootageRoot(). */
piclockDir: string;
/** e.g. "UNG_106" — mirrors the panel's getEpisodePrefix(); the picture-lock glob prefix. */
piclockGlobPrefix: string;
seqTimecodeStart: string | null;
seqTimecodeEnd: string | null;
/** Studio-standard head/tail handle count, applied symmetrically. */
handleFrames: number;
/** Full-duration (handles included), ungraded picture-lock reference render. */
piclockRefOutput: string;
slate: {
versionName: string;
date: string;
@@ -70,7 +58,6 @@ type ExportForPreview = {
fps: number;
vfxScope: string | null;
submissionNote: string | null;
noPictureLock: boolean;
};
/**
@@ -91,27 +78,18 @@ export async function buildPreviewManifest(exportRow: ExportForPreview): Promise
description: true,
notes: true,
slateDescription: true,
seqTimecodeStart: true,
seqTimecodeEnd: true,
project: { select: { name: true, code: true, showId: true, pipelineConfig: true } },
},
});
if (!shot) throw new PipelineError(404, "Shot not found for export");
const [cfg, handleFrames] = await Promise.all([getPreviewConfig(), getConfigNumber("validation.handleFrames")]);
const cfg = await getPreviewConfig();
// Per-production templates: each show has its own slate/overlay AEP, and
// above all its own show LUT. Falling back to another show's would render a
// preview that is quietly the wrong colour.
const templates = await resolveProjectTemplates(shot.project);
const base = `${shot.shotCode}_cmp_TT_${exportRow.versionString}`;
// Same convention as the panel's getShowFootageRoot()/getEpisodePrefix(): the
// picture-lock plate lives at {footageRoot}/{showId}/_PICLOCKS, glob-matched
// by "{showId}[_{episode}]_*".
const showId = shot.project.showId?.trim() || shot.project.code;
const piclockDir = templates.footageRoot ? `${templates.footageRoot}/${showId}/_PICLOCKS` : "";
const piclockGlobPrefix = shot.episode?.trim() ? `${showId}_${shot.episode.trim()}` : showId;
return {
stage: "PREVIEW",
exportId: exportRow.id,
@@ -132,13 +110,6 @@ export async function buildPreviewManifest(exportRow: ExportForPreview): Promise
mp4Output: `${exportRow.outputDir}/${base}.mp4`,
slateScopeProp: cfg.slateScopeProp,
slateSubmissionProp: cfg.slateSubmissionProp,
noPictureLock: exportRow.noPictureLock,
piclockDir,
piclockGlobPrefix,
seqTimecodeStart: shot.seqTimecodeStart,
seqTimecodeEnd: shot.seqTimecodeEnd,
handleFrames,
piclockRefOutput: `${exportRow.outputDir}/${base}_PICLOCK_REF.mp4`,
slate: {
versionName: base,
date: slateDate(),
@@ -187,7 +158,6 @@ export async function inheritPreviewMedia(
deliveryMovPath: true,
previewMovKey: true,
thumbnailKey: true,
piclockRefKey: true,
versionId: true,
},
});
@@ -204,7 +174,6 @@ export async function inheritPreviewMedia(
deliveryMovPath: donor.deliveryMovPath,
previewMovKey: donor.previewMovKey,
thumbnailKey: donor.thumbnailKey,
piclockRefKey: donor.piclockRefKey,
// The Version row stays attached to the export that actually produced the
// media; this one only points at the same files.
versionId: donor.versionId,
@@ -298,13 +267,9 @@ export interface FinalizeInput {
thumbnailKey?: string;
metadataKey?: string;
logFileKey?: string;
/** Full-duration, ungraded picture-lock reference MP4 — a diagnostic sidecar, not a Version. */
piclockRefKey?: string;
};
renderStats?: { renderSeconds?: number; previewSeconds?: number };
media?: { width?: number; height?: number; frameCount?: number; fps?: number; fileName?: string };
/** Why the picture-lock trim/reference was skipped, when it was — surfaced on the export's timeline. */
piclockSkippedReason?: string | null;
}
/**
@@ -473,12 +438,7 @@ export async function finalizePreview(jobId: string, machineId: string, body: Fi
? " — review version media replaced"
: ` — review version created (${inheritedApproval ?? "PENDING_REVIEW"})`
: " — no preview media reported") +
(taskRenamed ? ` — task renamed to ${taskTitle}` : "") +
(artifacts.piclockRefKey
? " — picture-lock reference built"
: body.piclockSkippedReason
? ` — picture lock skipped (${body.piclockSkippedReason})`
: ""),
(taskRenamed ? ` — task renamed to ${taskTitle}` : ""),
},
{
...(versionId ? { versionId } : {}),
@@ -486,7 +446,6 @@ export async function finalizePreview(jobId: string, machineId: string, body: Fi
...(artifacts.previewMovKey ? { previewMovKey: artifacts.previewMovKey } : {}),
...(artifacts.thumbnailKey ? { thumbnailKey: artifacts.thumbnailKey } : {}),
...(artifacts.metadataKey ? { metadataKey: artifacts.metadataKey } : {}),
...(artifacts.piclockRefKey ? { piclockRefKey: artifacts.piclockRefKey } : {}),
}
);