fix(pipeline): trim picture-lock handles at the footage comp, not the template's SHOT layer
Deploy / deploy (push) Successful in 6m17s
Deploy / deploy (push) Successful in 6m17s
Manipulating startTime/outPoint on previewComp's SHOT layer touched a comp duplicated from the artist-authored template, whose slate/shot timing relationship the build script doesn't own -- and it dropped the slate frame in production. The trim now happens one level down, on the private single-layer footage precomp this script fully controls; previewComp's own sizing logic is untouched from before this feature existed, since it already generalizes correctly to any shotComp duration. Also threads the picture-lock skip reason through to the export's timeline, so a shot missing sequence timecodes or a matching picture lock file is visible without digging into worker-machine logs. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -461,6 +461,7 @@ public sealed class JobExecutor
|
|||||||
["thumbnailKey"] = thumbKey,
|
["thumbnailKey"] = thumbKey,
|
||||||
["piclockRefKey"] = piclockRefKey,
|
["piclockRefKey"] = piclockRefKey,
|
||||||
},
|
},
|
||||||
|
["piclockSkippedReason"] = result.Build?.PiclockSkippedReason,
|
||||||
["renderStats"] = new Dictionary<string, object?>
|
["renderStats"] = new Dictionary<string, object?>
|
||||||
{
|
{
|
||||||
["previewSeconds"] = (int)result.Seconds,
|
["previewSeconds"] = (int)result.Seconds,
|
||||||
|
|||||||
@@ -484,22 +484,56 @@
|
|||||||
result.height = height;
|
result.height = height;
|
||||||
result.frameCount = Math.round(duration * fps);
|
result.frameCount = Math.round(duration * fps);
|
||||||
|
|
||||||
|
// Trim decision (§9, picture lock): the render's frame range is
|
||||||
|
// editorial ± a fixed symmetric handle count by studio convention (the
|
||||||
|
// same constant pullPictureLock hardcodes), so no picture-lock file is
|
||||||
|
// needed for this — only ctx.handleFrames. Applied at the footage/shot
|
||||||
|
// comp level (below) rather than by juggling layer timing inside
|
||||||
|
// previewComp — previewComp is duplicated from an artist-authored
|
||||||
|
// template whose slate/shot timing relationship this script does not
|
||||||
|
// own, so it is left completely untouched, exactly as it always
|
||||||
|
// rendered correctly before this feature existed.
|
||||||
|
var handleSeconds = (ctx.handleFrames || 0) / fps;
|
||||||
|
var contentDuration = duration;
|
||||||
|
var headSkipSeconds = 0;
|
||||||
|
var trimmedToPictureLock = false;
|
||||||
|
if (ctx.noPictureLock) {
|
||||||
|
result.piclockSkippedReason = "No Picture Lock was set for this export";
|
||||||
|
} else if (handleSeconds <= 0) {
|
||||||
|
result.piclockSkippedReason = "No handle frame count configured";
|
||||||
|
} else if (2 * handleSeconds >= duration) {
|
||||||
|
warn("Picture lock: handle count (" + ctx.handleFrames + "fr) covers the whole render (" +
|
||||||
|
result.frameCount + "fr) — trim skipped");
|
||||||
|
result.piclockSkippedReason = "handle count exceeds the render duration";
|
||||||
|
} else {
|
||||||
|
headSkipSeconds = handleSeconds;
|
||||||
|
contentDuration = duration - (2 * handleSeconds);
|
||||||
|
trimmedToPictureLock = true;
|
||||||
|
}
|
||||||
|
var contentStartFrame = (ctx.frameStart !== null && ctx.frameStart !== undefined)
|
||||||
|
? ctx.frameStart + Math.round(headSkipSeconds * fps)
|
||||||
|
: null;
|
||||||
|
|
||||||
// 3. Footage precomp (mirrors buildShotFromCode)
|
// 3. Footage precomp (mirrors buildShotFromCode)
|
||||||
var precompFolder = findFolder("_PRECOMPS");
|
var precompFolder = findFolder("_PRECOMPS");
|
||||||
var footageComp = app.project.items.addComp(
|
var footageComp = app.project.items.addComp(
|
||||||
ctx.shotCode + "_FOOTAGE", width, height, 1, duration, fps);
|
ctx.shotCode + "_FOOTAGE", width, height, 1, contentDuration, fps);
|
||||||
if (precompFolder) {
|
if (precompFolder) {
|
||||||
footageComp.parentFolder = precompFolder;
|
footageComp.parentFolder = precompFolder;
|
||||||
}
|
}
|
||||||
if (ctx.frameStart !== null && ctx.frameStart !== undefined) {
|
if (contentStartFrame !== null) {
|
||||||
setCompStartFrame(footageComp, ctx.frameStart);
|
setCompStartFrame(footageComp, contentStartFrame);
|
||||||
}
|
}
|
||||||
addOCIOToLayer(footageComp.layers.add(footage));
|
var footageLayer = footageComp.layers.add(footage);
|
||||||
|
if (headSkipSeconds > 0) {
|
||||||
|
footageLayer.startTime -= headSkipSeconds;
|
||||||
|
}
|
||||||
|
addOCIOToLayer(footageLayer);
|
||||||
|
|
||||||
// 4. Shot comp: footage + show LUT + overlay
|
// 4. Shot comp: footage + show LUT + overlay
|
||||||
var shotComp = app.project.items.addComp(ctx.shotCode, width, height, 1, duration, fps);
|
var shotComp = app.project.items.addComp(ctx.shotCode, width, height, 1, contentDuration, fps);
|
||||||
if (ctx.frameStart !== null && ctx.frameStart !== undefined) {
|
if (contentStartFrame !== null) {
|
||||||
setCompStartFrame(shotComp, ctx.frameStart);
|
setCompStartFrame(shotComp, contentStartFrame);
|
||||||
}
|
}
|
||||||
shotComp.layers.add(footageComp);
|
shotComp.layers.add(footageComp);
|
||||||
|
|
||||||
@@ -573,31 +607,12 @@
|
|||||||
warn("NETFLIX_SLATE layer not found in template — slate fields not filled");
|
warn("NETFLIX_SLATE layer not found in template — slate fields not filled");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Trim the client-facing comp back to the picture-lock edit (§9,
|
// previewComp sizes itself to whatever shotComp.duration actually is —
|
||||||
// picture lock): the render's frame range is editorial ± a fixed
|
// unchanged from before this feature existed. shotComp is already the
|
||||||
// symmetric handle count by studio convention (the same constant
|
// trimmed (or full, if skipped above) duration, so this needs no
|
||||||
// pullPictureLock hardcodes), so no picture-lock file is needed for
|
// special-casing here.
|
||||||
// this — only ctx.handleFrames. Both movOutput and mp4Output queue
|
|
||||||
// against this same previewComp, so trimming it once fixes both.
|
|
||||||
var shotLayer = previewComp.layer("SHOT");
|
var shotLayer = previewComp.layer("SHOT");
|
||||||
var handleSeconds = (ctx.handleFrames || 0) / fps;
|
var targetOutPoint = shotLayer.inPoint + shotComp.duration;
|
||||||
var visibleDuration = shotComp.duration;
|
|
||||||
var trimmedToPictureLock = false;
|
|
||||||
if (ctx.noPictureLock) {
|
|
||||||
result.piclockSkippedReason = "No Picture Lock was set for this export";
|
|
||||||
} else if (handleSeconds <= 0) {
|
|
||||||
result.piclockSkippedReason = "No handle frame count configured";
|
|
||||||
} else if (2 * handleSeconds >= shotComp.duration) {
|
|
||||||
warn("Picture lock: handle count (" + ctx.handleFrames + "fr) covers the whole render (" +
|
|
||||||
result.frameCount + "fr) — trim skipped");
|
|
||||||
result.piclockSkippedReason = "handle count exceeds the render duration";
|
|
||||||
} else {
|
|
||||||
shotLayer.startTime -= handleSeconds;
|
|
||||||
visibleDuration = shotComp.duration - (2 * handleSeconds);
|
|
||||||
trimmedToPictureLock = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
var targetOutPoint = shotLayer.inPoint + visibleDuration;
|
|
||||||
if (targetOutPoint > previewComp.duration) {
|
if (targetOutPoint > previewComp.duration) {
|
||||||
previewComp.duration = targetOutPoint;
|
previewComp.duration = targetOutPoint;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -303,6 +303,8 @@ export interface FinalizeInput {
|
|||||||
};
|
};
|
||||||
renderStats?: { renderSeconds?: number; previewSeconds?: number };
|
renderStats?: { renderSeconds?: number; previewSeconds?: number };
|
||||||
media?: { width?: number; height?: number; frameCount?: number; fps?: number; fileName?: string };
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -471,7 +473,12 @@ export async function finalizePreview(jobId: string, machineId: string, body: Fi
|
|||||||
? " — review version media replaced"
|
? " — review version media replaced"
|
||||||
: ` — review version created (${inheritedApproval ?? "PENDING_REVIEW"})`
|
: ` — review version created (${inheritedApproval ?? "PENDING_REVIEW"})`
|
||||||
: " — no preview media reported") +
|
: " — no preview media reported") +
|
||||||
(taskRenamed ? ` — task renamed to ${taskTitle}` : ""),
|
(taskRenamed ? ` — task renamed to ${taskTitle}` : "") +
|
||||||
|
(artifacts.piclockRefKey
|
||||||
|
? " — picture-lock reference built"
|
||||||
|
: body.piclockSkippedReason
|
||||||
|
? ` — picture lock skipped (${body.piclockSkippedReason})`
|
||||||
|
: ""),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
...(versionId ? { versionId } : {}),
|
...(versionId ? { versionId } : {}),
|
||||||
|
|||||||
Reference in New Issue
Block a user