feat(pipeline): per-project AE templates, and a workspace that fits any show
Deploy / deploy (push) Successful in 7m4s

Initialise Workspace built UNG_101..UNG_117 from a hardcoded range and
imported one hardcoded AEP, and fourteen findComp calls named UNG's comps
literally. None of it worked for a second show.

Comp names now follow a convention derived from the show id —
{showId}_VFX_OVERLAY, {showId}_EXPORT_TEMPLATE, _SHOW LUT — which
reproduces UNG's existing names exactly, so nothing changes for the show
it was written for. A project whose template departs from the pattern can
override any of the three.

Paths cannot be derived: UNG's show id is UNG while its folder is
UNGO_VFX. Those live on Project.pipelineConfig and are edited under
Project → Settings → Pipeline. They are resolved server-side and handed
to the panel with the project list, and read by buildPreviewManifest for
the headless build, so the panel and the farm cannot disagree about which
template — or which show LUT — a shot was built with. That mattered more
than the folder names: a preview rendered through another show's LUT is
quietly the wrong colour rather than obviously broken.

Episode folders come from the project's episode list, falling back to the
folders under its footage root for a show whose episodes are not entered
yet.

Panel 2.5.0. Adds migration 20260814010000_project_pipeline_config.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
twotalesanimation
2026-08-15 08:24:40 +02:00
parent 483db65eb3
commit bada122f42
12 changed files with 430 additions and 45 deletions
+110 -30
View File
@@ -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.4.0";
var PANEL_VERSION = "2.5.0";
(function VFXReviewConnector(thisObj) {
var uiState = {
@@ -701,6 +701,37 @@ var PANEL_VERSION = "2.4.0";
return CURRENT_PROJECT ? trimText(CURRENT_PROJECT.showId || CURRENT_PROJECT.code) : "";
}
// ── Per-project templates ─────────────────────────────────────────────────
//
// The server resolves these (convention from the show id, overridden per
// project where a template departs from it) and hands them over with the
// project list, so the panel and the headless preview build cannot disagree
// about which template — or which show LUT — a shot was built with.
function getTemplates() {
return (CURRENT_PROJECT && CURRENT_PROJECT.templates) ? CURRENT_PROJECT.templates : {};
}
function getOverlayCompName() {
return trimText(getTemplates().overlayComp) || (getShowId() ? getShowId() + "_VFX_OVERLAY" : "VFX_OVERLAY");
}
function getPreviewTemplateCompName() {
return trimText(getTemplates().previewComp) || (getShowId() ? getShowId() + "_EXPORT_TEMPLATE" : "EXPORT_TEMPLATE");
}
function getLutCompName() {
return trimText(getTemplates().lutComp) || "_SHOW LUT";
}
function getTemplateAepPath() {
return trimText(getTemplates().templateAep);
}
function getRendersRoot() {
return trimText(getTemplates().rendersRoot);
}
function isEpisodicProject() {
return !!(CURRENT_PROJECT && CURRENT_PROJECT.projectType === "EPISODIC");
}
@@ -1340,7 +1371,7 @@ var PANEL_VERSION = "2.4.0";
layer = comp.layer(i);
try {
if (layer.source && layer.source instanceof CompItem && layer.source.name === "UNG_VFX_OVERLAY") {
if (layer.source && layer.source instanceof CompItem && layer.source.name === getOverlayCompName()) {
return layer;
}
} catch (layerError) {
@@ -1508,7 +1539,7 @@ var PANEL_VERSION = "2.4.0";
}
function updateOverlayForComp(comp, shotCode, apiData) {
var overlayComp = findComp("UNG_VFX_OVERLAY");
var overlayComp = findComp(getOverlayCompName());
var overlayLayer;
var essentialProperties;
var overlayShotCode;
@@ -1597,8 +1628,8 @@ var PANEL_VERSION = "2.4.0";
shotCode = shot.shotCode;
exrOutput = shot.exrOutput;
disableLayerByName(comp, "UNG_VFX_OVERLAY");
disableLayerByName(comp, "_SHOW LUT");
disableLayerByName(comp, getOverlayCompName());
disableLayerByName(comp, getLutCompName());
folderPath = getShotExportDir(shot);
if (!ensureFolder(folderPath)) {
@@ -1621,7 +1652,7 @@ var PANEL_VERSION = "2.4.0";
function addOverlay() {
var comps = getSelectedComps();
var overlayComp = findComp("UNG_VFX_OVERLAY");
var overlayComp = findComp(getOverlayCompName());
var overlayLayer;
var added = 0;
var updated = 0;
@@ -1642,7 +1673,7 @@ var PANEL_VERSION = "2.4.0";
}
if (!overlayComp) {
updateStatus(comps.length, "UNG_VFX_OVERLAY not found.");
updateStatus(comps.length, getOverlayCompName() + " not found.");
return;
}
@@ -1682,7 +1713,7 @@ var PANEL_VERSION = "2.4.0";
}
function buildPreviewForShot(shotComp, shotCode, apiData) {
var templateComp = findComp("UNG_EXPORT_TEMPLATE");
var templateComp = findComp(getPreviewTemplateCompName());
var previewsFolder = findFolder("_PREVIEWS");
var shot;
var previewComp;
@@ -1796,7 +1827,7 @@ var PANEL_VERSION = "2.4.0";
if (existingShotComp) {
diagLog("comp " + shotCode + " already exists — refreshing its overlay only");
if (!updateOverlayForComp(existingShotComp, shotCode, apiData)) {
diagLog("overlay refresh failed (non-fatal): UNG_VFX_OVERLAY comp or its Essential Properties are missing");
diagLog("overlay refresh failed (non-fatal): " + getOverlayCompName() + " comp or its Essential Properties are missing");
}
return existingShotComp;
}
@@ -1909,16 +1940,16 @@ var PANEL_VERSION = "2.4.0";
return null;
}
showLut = findComp("_SHOW LUT");
showLut = findComp(getLutCompName());
if (showLut) {
lutLayer = shotComp.layers.add(showLut);
lutLayer.collapseTransformation = true;
} else {
diagLog("no _SHOW LUT comp in this project — shot built without it");
diagLog("no " + getLutCompName() + " comp in this project — shot built without it");
}
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("overlay not applied (non-fatal): " + getOverlayCompName() + " comp missing, or its DATE/SHOT NAME Essential Properties are not exposed");
}
diagLog("built comp " + shotComp.name + " (" + width + "x" + height + " @ " + fps + " fps, " +
Math.round(maxDuration * fps) + " frames, " + footageItems.length + " plate layer(s))");
@@ -2018,7 +2049,7 @@ var PANEL_VERSION = "2.4.0";
var exportRoot;
var names;
var missingItems = [];
var requiredComps = ["UNG_VFX_OVERLAY", "UNG_EXPORT_TEMPLATE", "_SHOW LUT"];
var requiredComps = [getOverlayCompName(), getPreviewTemplateCompName(), getLutCompName()];
var requiredFolders = ["__SHOTS", "_FOOTAGE_4K", "_PRECOMPS", "_PREVIEWS"];
var i;
@@ -2156,7 +2187,7 @@ var PANEL_VERSION = "2.4.0";
function buildPreviews() {
var comps = getTargetComps();
var templateComp = findComp("UNG_EXPORT_TEMPLATE");
var templateComp = findComp(getPreviewTemplateCompName());
var created = 0;
var skipped = 0;
var i;
@@ -2171,7 +2202,7 @@ var PANEL_VERSION = "2.4.0";
}
if (!templateComp) {
updateStatus(comps.length, "UNG_EXPORT_TEMPLATE not found.");
updateStatus(comps.length, getPreviewTemplateCompName() + " not found.");
return;
}
@@ -2293,8 +2324,8 @@ var PANEL_VERSION = "2.4.0";
}
shotCode = shot.shotCode;
disableLayerByName(comp, "UNG_VFX_OVERLAY");
disableLayerByName(comp, "_SHOW LUT");
disableLayerByName(comp, getOverlayCompName());
disableLayerByName(comp, getLutCompName());
folderPath = getShotExportDir(shot);
if (!ensureFolder(folderPath)) {
@@ -2448,7 +2479,14 @@ var PANEL_VERSION = "2.4.0";
// 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 (!getRendersRoot()) {
updateStatus(getSelectedComps().length,
"No renders root configured for " + (CURRENT_PROJECT ? CURRENT_PROJECT.code : "this project") +
" — set it on the project's Pipeline settings in the web app.");
return;
}
rendersRoot = new Folder(getRendersRoot().replace(/\/+$/, "") + "/" + shotCode);
if (!rendersRoot.exists) {
updateStatus(getSelectedComps().length, "Renders folder not found: " + rendersRoot.fsName);
@@ -2905,12 +2943,38 @@ var PANEL_VERSION = "2.4.0";
return newFolder;
}
/**
* Episode folder names for __SHOTS. The API is the authority; the footage
* root is the fallback for a show whose episodes have not been entered yet,
* so Initialise Workspace still produces something useful on day one.
*/
function getEpisodeCodesForWorkspace() {
var codes = [];
var episodes = getEpisodesFromAPI();
var label;
var i;
for (i = 0; i < episodes.length; i += 1) {
label = trimText(getEpisodeLabel(episodes[i]));
if (label) {
addUniqueText(codes, deriveEpisodeCode(label));
}
}
if (codes.length < 1) {
codes = getEpisodeCodesFromDisk();
diagLog("no episodes from the API — using " + codes.length + " folder(s) found under the footage root");
}
codes.sort();
return codes;
}
function initialiseWorkspace() {
var topFolderNames = ["_PREVIEWS", "_PRECOMPS", "_PICLOCKS", "_FOOTAGE_4K", "_STOCK", "_RENDERS", "_UTILITIES"];
var templatePath = "X:/shared_projects_2026/UNGO_VFX/production/working_files/UNG_VFXOVERLAY_SLATE_TEMPLATE.aep";
var templatePath = getTemplateAepPath();
var shotsFolder;
var epNum;
var epCode;
var episodes;
var templateFile;
var importOptions;
var importStatus;
@@ -2920,14 +2984,20 @@ var PANEL_VERSION = "2.4.0";
updateStatus(0, "No project open.");
return;
}
if (!CURRENT_PROJECT) {
updateStatus(0, "Select a project first — the workspace is built from its episodes and template.");
return;
}
app.beginUndoGroup("VFXReview Connector - Initialise Workspace");
// Create __SHOTS with UNG_101 – UNG_117 subfolders
// __SHOTS holds one folder per episode, taken from the project itself
// rather than a hardcoded range: a show's episode list is the server's
// to know, and standard (non-episodic) shows have none at all.
shotsFolder = findOrCreateFolder("__SHOTS", null);
for (epNum = 101; epNum <= 117; epNum += 1) {
epCode = "UNG_" + epNum;
findOrCreateFolder(epCode, shotsFolder);
episodes = isEpisodicProject() ? getEpisodeCodesForWorkspace() : [];
for (i = 0; i < episodes.length; i += 1) {
findOrCreateFolder(episodes[i], shotsFolder);
}
// Create remaining top-level folders
@@ -2935,10 +3005,17 @@ var PANEL_VERSION = "2.4.0";
findOrCreateFolder(topFolderNames[i], null);
}
// Import AEP template
// Import the show's own template AEP — its overlay, slate template and
// show LUT. Another show's would be quietly the wrong colour.
importStatus = "";
templateFile = new File(templatePath);
if (templateFile.exists) {
if (!templatePath) {
importStatus = " No template AEP configured for " + CURRENT_PROJECT.code +
" — set it on the project's Pipeline settings in the web app.";
templateFile = null;
} else {
templateFile = new File(templatePath);
}
if (templateFile && templateFile.exists) {
try {
importOptions = new ImportOptions(templateFile);
importOptions.importAs = ImportAsType.PROJECT;
@@ -2996,7 +3073,10 @@ var PANEL_VERSION = "2.4.0";
colorStatus += " OCIO config must be set manually in Project Settings.";
}
updateStatus(getSelectedComps().length, "Workspace initialised." + importStatus + colorStatus);
updateStatus(getSelectedComps().length,
"Workspace initialised for " + CURRENT_PROJECT.code +
(episodes.length ? " (" + episodes.length + " episode folder(s))" : "") +
"." + importStatus + colorStatus);
}
function clearDropdown(dropdown) {
@@ -3264,7 +3344,7 @@ var PANEL_VERSION = "2.4.0";
data.shot.shotVersion = newVersion;
versionName = shotCode + "_cmp_TT_" + newVersion;
// 1. Update SHOT NAME on UNG_VFX_OVERLAY inside the selected comp
// 1. Update SHOT NAME on the show overlay inside the selected comp
updateOverlayForComp(comps[i], shotCode, data);
// 2. Update {shotCode}_PREVIEW slate VersionName if the comp exists