fix(connector): build shots at the shot's frame rate, not a hardcoded 24
Deploy / deploy (push) Successful in 6m23s
Deploy / deploy (push) Successful in 6m23s
Shot.fps existed, the lookup API returned it, and one button honoured it — Set Start Timecode — while the shot builder ignored it entirely. Comps were created at 24 and every plate conformed to 24. DH2 is a 25 fps show. Its plates carry framesPerSecond 25/1, so comps built at 24 conform every plate to the wrong speed and compute every frame-from-timecode sum against the wrong rate. The builder now takes the rate from the shot record, which is the show's delivery rate and therefore the authority; a plate's own rate is whatever happens to be on disk. Import Renders follows the comp it imports into, and Import EXR follows the shot. Validation gains plate_fps, comparing the render against the timing plate. timecode_fps only compares the render to its manifest and both come from the comp, so a shot built at the wrong rate agrees with itself and passes; the plate is the independent witness. It is a WARN, never a FAIL: sampling DH2 found one plate at 50 fps against a 25 fps show, a deliberate over-crank, so a whole-number multiple is reported as exactly that and anything else as a probable rate mistake. Note this does not fix the data: all 175 DH2 shots still carry fps 24 from the create-time default and need correcting before their comps are rebuilt. Panel 2.4.0, worker 1.4.0. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
+40
-16
@@ -32,7 +32,7 @@ var SETTINGS_KEY = "cfg";
|
||||
// Bump on every change deployed to a workstation. The panel reports this to
|
||||
// the server on load, so Pipeline → Machines shows which version each machine
|
||||
// is actually running and flags the ones left behind.
|
||||
var PANEL_VERSION = "2.3.0";
|
||||
var PANEL_VERSION = "2.4.0";
|
||||
|
||||
(function VFXReviewConnector(thisObj) {
|
||||
var uiState = {
|
||||
@@ -1218,7 +1218,7 @@ var PANEL_VERSION = "2.3.0";
|
||||
return matches;
|
||||
}
|
||||
|
||||
function importEXRSequence(folder) {
|
||||
function importEXRSequence(folder, fps) {
|
||||
var files = folder.getFiles("*.exr");
|
||||
var importOptions;
|
||||
var footage;
|
||||
@@ -1231,10 +1231,28 @@ var PANEL_VERSION = "2.3.0";
|
||||
importOptions = new ImportOptions(files[0]);
|
||||
importOptions.sequence = true;
|
||||
footage = app.project.importFile(importOptions);
|
||||
footage.mainSource.conformFrameRate = 24;
|
||||
// Conform to the show's rate, not a hardcoded 24: conforming a 25 fps
|
||||
// plate to 24 changes its duration and every frame-from-timecode sum
|
||||
// that follows.
|
||||
footage.mainSource.conformFrameRate = resolveFps(fps);
|
||||
return footage;
|
||||
}
|
||||
|
||||
/**
|
||||
* The frame rate to build at. The shot record is the show's delivery rate
|
||||
* and therefore the authority; a plate's own rate is what happens to be on
|
||||
* disk, and where they differ the plate is the thing that is wrong.
|
||||
*/
|
||||
function resolveFps(fps) {
|
||||
var value = Number(fps);
|
||||
|
||||
return (value && value > 0) ? value : 24;
|
||||
}
|
||||
|
||||
function getShotFps(shot) {
|
||||
return resolveFps(shot && shot.fps);
|
||||
}
|
||||
|
||||
function addOCIOToLayer(layer) {
|
||||
var ocio;
|
||||
var outputProp;
|
||||
@@ -1751,6 +1769,7 @@ var PANEL_VERSION = "2.3.0";
|
||||
var folderNames;
|
||||
var emptyFolderNotes = [];
|
||||
var importFailure;
|
||||
var fps = 24;
|
||||
|
||||
diagLog("build: shot=" + shotCode + " group=" + (groupCode || "(none)") +
|
||||
" episodic=" + isEpisodicProject());
|
||||
@@ -1769,9 +1788,10 @@ var PANEL_VERSION = "2.3.0";
|
||||
["Looked up under project " + CURRENT_PROJECT.code + " — a shot belonging to another project will not be found."]));
|
||||
return null;
|
||||
}
|
||||
fps = getShotFps(apiData.shot);
|
||||
diagLog("shot found: version " + (apiData.shot.shotVersion || "?") +
|
||||
", episode " + (apiData.shot.episode || "-") + ", scene " + (apiData.shot.scene || "-") +
|
||||
", tc " + (apiData.shot.timecodeStart || "-"));
|
||||
", tc " + (apiData.shot.timecodeStart || "-") + ", " + fps + " fps");
|
||||
|
||||
if (existingShotComp) {
|
||||
diagLog("comp " + shotCode + " already exists — refreshing its overlay only");
|
||||
@@ -1817,7 +1837,7 @@ var PANEL_VERSION = "2.3.0";
|
||||
footage = null;
|
||||
importFailure = "";
|
||||
try {
|
||||
footage = importEXRSequence(sequenceFolders[i]);
|
||||
footage = importEXRSequence(sequenceFolders[i], fps);
|
||||
} catch (importError) {
|
||||
importFailure = describeError(importError);
|
||||
diagLog("import threw for " + sequenceFolders[i].fsName + ": " + importFailure);
|
||||
@@ -1825,7 +1845,7 @@ var PANEL_VERSION = "2.3.0";
|
||||
|
||||
if (footage) {
|
||||
diagLog("imported " + sequenceFolders[i].name + " (" + footage.width + "x" + footage.height +
|
||||
", " + Math.round(footage.duration * 24) + " frames)");
|
||||
", " + Math.round(footage.duration * fps) + " frames at " + fps + " fps)");
|
||||
footage.name = sequenceFolders[i].name;
|
||||
if (footageFolder) {
|
||||
footage.parentFolder = footageFolder;
|
||||
@@ -1856,13 +1876,13 @@ var PANEL_VERSION = "2.3.0";
|
||||
try {
|
||||
// Both comps start at the plate's native start timecode (as AE would
|
||||
// when creating a comp from the footage), not at frame 0.
|
||||
startInfo = getFootageStartFrames(primaryFootage, apiData.shot, 24);
|
||||
startInfo = getFootageStartFrames(primaryFootage, apiData.shot, fps);
|
||||
buildState.lastStartSource = startInfo.source;
|
||||
buildState.lastStartFrames = startInfo.frames;
|
||||
buildState.lastStartShotCode = shotCode;
|
||||
diagLog("start frame " + startInfo.frames + " from " + startInfo.source);
|
||||
|
||||
footageComp = app.project.items.addComp(shotCode + "_FOOTAGE", width, height, 1, maxDuration, 24);
|
||||
footageComp = app.project.items.addComp(shotCode + "_FOOTAGE", width, height, 1, maxDuration, fps);
|
||||
setCompStartFrame(footageComp, startInfo.frames);
|
||||
if (precompFolder) {
|
||||
footageComp.parentFolder = precompFolder;
|
||||
@@ -1873,7 +1893,7 @@ var PANEL_VERSION = "2.3.0";
|
||||
addOCIOToLayer(footageLayer);
|
||||
}
|
||||
|
||||
shotComp = app.project.items.addComp(shotCode, width, height, 1, maxDuration, 24);
|
||||
shotComp = app.project.items.addComp(shotCode, width, height, 1, maxDuration, fps);
|
||||
setCompStartFrame(shotComp, startInfo.frames);
|
||||
if (episodeProjectFolder) {
|
||||
shotComp.parentFolder = episodeProjectFolder;
|
||||
@@ -1900,8 +1920,8 @@ var PANEL_VERSION = "2.3.0";
|
||||
if (!updateOverlayForComp(shotComp, shotCode, apiData)) {
|
||||
diagLog("overlay not applied (non-fatal): UNG_VFX_OVERLAY comp missing, or its DATE/SHOT NAME Essential Properties are not exposed");
|
||||
}
|
||||
diagLog("built comp " + shotComp.name + " (" + width + "x" + height + ", " +
|
||||
Math.round(maxDuration * 24) + " frames, " + footageItems.length + " plate layer(s))");
|
||||
diagLog("built comp " + shotComp.name + " (" + width + "x" + height + " @ " + fps + " fps, " +
|
||||
Math.round(maxDuration * fps) + " frames, " + footageItems.length + " plate layer(s))");
|
||||
return shotComp;
|
||||
}
|
||||
|
||||
@@ -2380,7 +2400,7 @@ var PANEL_VERSION = "2.3.0";
|
||||
importOptions = new ImportOptions(files[0]);
|
||||
importOptions.sequence = true;
|
||||
footage = app.project.importFile(importOptions);
|
||||
footage.mainSource.conformFrameRate = 24;
|
||||
footage.mainSource.conformFrameRate = getShotFps(shot);
|
||||
} catch (importErr) {
|
||||
updateStatus(comps.length, "Import failed for " + shot.shotCode + ": " + importErr.message);
|
||||
skipped += 1;
|
||||
@@ -2416,6 +2436,7 @@ var PANEL_VERSION = "2.3.0";
|
||||
var footage;
|
||||
var layer;
|
||||
var i;
|
||||
var renderFps;
|
||||
|
||||
if (comps.length < 1) {
|
||||
updateStatus(0, "Please select or open a comp first.");
|
||||
@@ -2424,6 +2445,9 @@ var PANEL_VERSION = "2.3.0";
|
||||
|
||||
comp = comps[0];
|
||||
shotCode = getShotCodeFromComp(comp);
|
||||
// The comp being imported into is already at the show's rate; conforming
|
||||
// renders to anything else would resample them.
|
||||
renderFps = resolveFps(comp.frameRate);
|
||||
rendersRoot = new Folder("X:/shared_projects_2026/UNGO_VFX/production/renders/" + shotCode);
|
||||
|
||||
if (!rendersRoot.exists) {
|
||||
@@ -2439,10 +2463,10 @@ var PANEL_VERSION = "2.3.0";
|
||||
subFolders = rendersRoot.getFiles();
|
||||
for (i = 0; i < subFolders.length; i += 1) {
|
||||
if (subFolders[i] instanceof Folder) {
|
||||
footage = importEXRSequence(subFolders[i]);
|
||||
footage = importEXRSequence(subFolders[i], renderFps);
|
||||
if (footage) {
|
||||
footage.name = subFolders[i].name;
|
||||
footage.mainSource.conformFrameRate = 24;
|
||||
footage.mainSource.conformFrameRate = renderFps;
|
||||
if (rendersProjectFolder) {
|
||||
footage.parentFolder = rendersProjectFolder;
|
||||
}
|
||||
@@ -2453,10 +2477,10 @@ var PANEL_VERSION = "2.3.0";
|
||||
|
||||
// Fall back to sequences directly in the root renders folder
|
||||
if (importedFootage.length < 1) {
|
||||
footage = importEXRSequence(rendersRoot);
|
||||
footage = importEXRSequence(rendersRoot, renderFps);
|
||||
if (footage) {
|
||||
footage.name = shotCode + "_render";
|
||||
footage.mainSource.conformFrameRate = 24;
|
||||
footage.mainSource.conformFrameRate = renderFps;
|
||||
if (rendersProjectFolder) {
|
||||
footage.parentFolder = rendersProjectFolder;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user