feat(pipeline): automate picture-lock trimming in the preview build
Deploy / deploy (push) Successful in 10m37s
Deploy / deploy (push) Successful in 10m37s
Previews used to ship the full padded (handle-included) render to clients, with an artist manually pulling picture lock and hand-trimming the comp to match. The automated preview stage now trims the client comp to the picture-lock edit itself (a fixed handle count off each end, per the studio's existing convention) and separately builds an ungraded, full-duration picture-lock reference MP4 as a diagnostic sidecar to check back against. A new "No Picture Lock" panel checkbox is the single override for shots where picture lock is missing or wrong, falling back to today's untrimmed behavior. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -26,7 +26,11 @@ export const PIPELINE_CONFIG_DEFAULTS = {
|
||||
"validation.sampleEvery": 25,
|
||||
/** Per-check severity overrides, e.g. {"exr_type":"warn"} (§17.3). */
|
||||
"validation.overrides": "{}",
|
||||
/** Frames of head handle the plates carry; only used for the API timecode fallback (§8.1a). */
|
||||
/**
|
||||
* Frames of head/tail handle the studio pads every render with. Used for the
|
||||
* API timecode fallback (§8.1a) and, symmetrically, to trim the preview
|
||||
* build's client-facing comp back to the picture-lock edit (§9).
|
||||
*/
|
||||
"validation.handleFrames": 8,
|
||||
/**
|
||||
* Studio-wide delivery defaults (§11.2). A project's own `deliveryConfig`
|
||||
@@ -43,6 +47,11 @@ export const PIPELINE_CONFIG_DEFAULTS = {
|
||||
"preview.lutComp": "_SHOW LUT",
|
||||
"preview.movTemplate": "4444 Tri",
|
||||
"preview.mp4Template": "REVIEW_PREVIEW",
|
||||
// Bare footage root the preview build reads picture-lock plates from, at
|
||||
// `{footageRoot}/{showId}/_PICLOCKS` — same convention as the panel's own
|
||||
// "Footage Root" setting (VFXReviewConnector.md). Per-project override via
|
||||
// pipelineConfig.footageRoot for a show on different storage.
|
||||
"preview.footageRoot": "V:/_FOOTAGE",
|
||||
// Essential Property names on the NETFLIX_SLATE layer for the per-submission
|
||||
// fields. If a name is wrong the build logs the template's actual property
|
||||
// names as a warning, so it is a config fix rather than a code change.
|
||||
|
||||
@@ -70,6 +70,11 @@ export interface CreateExportInput {
|
||||
* frames would produce the wrong MOV.
|
||||
*/
|
||||
skipPreview?: boolean;
|
||||
/**
|
||||
* Skip picture-lock trimming and the picture-lock reference render for this
|
||||
* export — set when picture lock is missing or wrong for the shot.
|
||||
*/
|
||||
noPictureLock?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -205,6 +210,7 @@ export async function createExport(input: CreateExportInput) {
|
||||
vfxScope,
|
||||
submissionNote,
|
||||
skipPreview: input.skipPreview === true,
|
||||
noPictureLock: input.noPictureLock === true,
|
||||
submittedById: submittedBy?.id ?? null,
|
||||
submittedByName: submittedBy?.name ?? input.submittedByEmail ?? null,
|
||||
},
|
||||
@@ -247,7 +253,8 @@ export async function createExport(input: CreateExportInput) {
|
||||
actorId: submittedBy?.id ?? null,
|
||||
note:
|
||||
`Queue Export ${versionString}${input.force ? " (force)" : ""}` +
|
||||
`${input.skipPreview ? " (skip preview)" : ""} — ` +
|
||||
`${input.skipPreview ? " (skip preview)" : ""}` +
|
||||
`${input.noPictureLock ? " (no picture lock)" : ""} — ` +
|
||||
`${provenance.ok ? "" : "WARNING: "}${provenance.note}`,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -32,6 +32,18 @@ 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;
|
||||
@@ -58,6 +70,7 @@ type ExportForPreview = {
|
||||
fps: number;
|
||||
vfxScope: string | null;
|
||||
submissionNote: string | null;
|
||||
noPictureLock: boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -78,18 +91,27 @@ 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 = await getPreviewConfig();
|
||||
const [cfg, handleFrames] = await Promise.all([getPreviewConfig(), getConfigNumber("validation.handleFrames")]);
|
||||
// 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,
|
||||
@@ -110,6 +132,13 @@ 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(),
|
||||
@@ -158,6 +187,7 @@ export async function inheritPreviewMedia(
|
||||
deliveryMovPath: true,
|
||||
previewMovKey: true,
|
||||
thumbnailKey: true,
|
||||
piclockRefKey: true,
|
||||
versionId: true,
|
||||
},
|
||||
});
|
||||
@@ -174,6 +204,7 @@ 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,
|
||||
@@ -267,6 +298,8 @@ 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 };
|
||||
@@ -446,6 +479,7 @@ 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 } : {}),
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -20,6 +20,10 @@ export const pipelineConfigSchema = z.object({
|
||||
templateAep: z.string().max(1000).optional().nullable(),
|
||||
/** Where per-shot pre-renders live, imported by Import Renders. */
|
||||
rendersRoot: z.string().max(1000).optional().nullable(),
|
||||
/** Bare footage root (e.g. "V:/_FOOTAGE") the panel's Pull Picture Lock reads
|
||||
* from at `{footageRoot}/{showId}/_PICLOCKS` — same convention as the panel's
|
||||
* own `getShowFootageRoot()`. */
|
||||
footageRoot: z.string().max(1000).optional().nullable(),
|
||||
/** Overrides for templates that depart from the {showId}_* convention. */
|
||||
overlayComp: z.string().max(200).optional().nullable(),
|
||||
previewComp: z.string().max(200).optional().nullable(),
|
||||
@@ -34,6 +38,7 @@ export type PipelineConfigInput = z.infer<typeof pipelineConfigSchema>;
|
||||
export interface ResolvedTemplates {
|
||||
templateAep: string;
|
||||
rendersRoot: string;
|
||||
footageRoot: string;
|
||||
overlayComp: string;
|
||||
previewComp: string;
|
||||
lutComp: string;
|
||||
@@ -78,10 +83,11 @@ export async function resolveProjectTemplates(project: {
|
||||
return fallback;
|
||||
};
|
||||
|
||||
const [defaultAep, defaultMov, defaultMp4] = await Promise.all([
|
||||
const [defaultAep, defaultMov, defaultMp4, defaultFootageRoot] = await Promise.all([
|
||||
getConfigValue("preview.templateAep"),
|
||||
getConfigValue("preview.movTemplate"),
|
||||
getConfigValue("preview.mp4Template"),
|
||||
getConfigValue("preview.footageRoot"),
|
||||
]);
|
||||
|
||||
return {
|
||||
@@ -89,6 +95,7 @@ export async function resolveProjectTemplates(project: {
|
||||
// No sensible studio-wide default: a renders root that points at another
|
||||
// show's folder is worse than an empty one the panel can report.
|
||||
rendersRoot: pick("rendersRoot", ""),
|
||||
footageRoot: pick("footageRoot", defaultFootageRoot),
|
||||
overlayComp: pick("overlayComp", convention.overlayComp),
|
||||
previewComp: pick("previewComp", convention.previewComp),
|
||||
lutComp: pick("lutComp", convention.lutComp),
|
||||
|
||||
Reference in New Issue
Block a user