feat(connector): per-shot/version export folders, scene filter
Panel export paths now mirror the server's layout
({exportRoot}/{showId}/[{episode} if episodic]/{shotCode}/{version}) via a new
getShotExportDir helper, so farm and local renders land in the same folder.
Folder creation moves into the per-shot loop so one unwritable path no longer
aborts the whole queue.
Also adds an optional `scene` query param to the ext shots endpoint.
This commit is contained in:
+33
-11
@@ -315,6 +315,27 @@ var SETTINGS_KEY = "cfg";
|
|||||||
return CONFIG.footageRoot + (showId ? "/" + showId : "");
|
return CONFIG.footageRoot + (showId ? "/" + showId : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Mirrors the server's export layout so farm and local renders land together:
|
||||||
|
// {exportRoot}/{showId}/[{episode} for episodic]/{shotCode}/{version}
|
||||||
|
function getShotExportDir(shot) {
|
||||||
|
var path = getShowExportRoot();
|
||||||
|
var episode;
|
||||||
|
var match;
|
||||||
|
|
||||||
|
if (CURRENT_PROJECT && CURRENT_PROJECT.projectType === "EPISODIC") {
|
||||||
|
episode = trimText(shot.episode);
|
||||||
|
if (!episode) {
|
||||||
|
match = String(shot.shotCode).match(/^[A-Z]{3}_(\d{3})_/);
|
||||||
|
episode = match ? match[1] : "";
|
||||||
|
}
|
||||||
|
if (episode) {
|
||||||
|
path += "/" + episode;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return path + "/" + shot.shotCode + "/" + (shot.shotVersion || "v001");
|
||||||
|
}
|
||||||
|
|
||||||
function ensureFolder(path) {
|
function ensureFolder(path) {
|
||||||
var folder = new Folder(path);
|
var folder = new Folder(path);
|
||||||
var parent;
|
var parent;
|
||||||
@@ -912,7 +933,7 @@ var SETTINGS_KEY = "cfg";
|
|||||||
disableLayerByName(comp, "UNG_VFX_OVERLAY");
|
disableLayerByName(comp, "UNG_VFX_OVERLAY");
|
||||||
disableLayerByName(comp, "_SHOW LUT");
|
disableLayerByName(comp, "_SHOW LUT");
|
||||||
|
|
||||||
folderPath = getShowExportRoot() + "/" + shotCode;
|
folderPath = getShotExportDir(shot);
|
||||||
if (!ensureFolder(folderPath)) {
|
if (!ensureFolder(folderPath)) {
|
||||||
addFailure(result, comp.name, "Could not create output folder");
|
addFailure(result, comp.name, "Could not create output folder");
|
||||||
continue;
|
continue;
|
||||||
@@ -1242,14 +1263,9 @@ var SETTINGS_KEY = "cfg";
|
|||||||
var mainComp;
|
var mainComp;
|
||||||
var previewComp;
|
var previewComp;
|
||||||
var outputPath;
|
var outputPath;
|
||||||
|
var folderPath;
|
||||||
|
|
||||||
app.beginUndoGroup("VFXReview Connector - Queue " + label);
|
app.beginUndoGroup("VFXReview Connector - Queue " + label);
|
||||||
if (!ensureFolder(getShowExportRoot())) {
|
|
||||||
app.endUndoGroup();
|
|
||||||
updateStatus(comps.length, "Could not create export folder.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < comps.length; i += 1) {
|
for (i = 0; i < comps.length; i += 1) {
|
||||||
shotCode = getShotCodeFromComp(comps[i]);
|
shotCode = getShotCodeFromComp(comps[i]);
|
||||||
updateStatus(comps.length, "Preparing " + label + " preview for " + shotCode + " (" + (i + 1) + " of " + comps.length + ")");
|
updateStatus(comps.length, "Preparing " + label + " preview for " + shotCode + " (" + (i + 1) + " of " + comps.length + ")");
|
||||||
@@ -1282,7 +1298,13 @@ var SETTINGS_KEY = "cfg";
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateStatus(comps.length, "Queueing " + label + " for " + shotCode + " (" + (i + 1) + " of " + comps.length + ")");
|
updateStatus(comps.length, "Queueing " + label + " for " + shotCode + " (" + (i + 1) + " of " + comps.length + ")");
|
||||||
outputPath = getShowExportRoot() + "/" + shotCode + "_cmp_TT_" + (apiData.shot.shotVersion || "v001") + "." + extension;
|
folderPath = getShotExportDir(apiData.shot);
|
||||||
|
if (!ensureFolder(folderPath)) {
|
||||||
|
addFailure(result, comps[i].name, "Could not create output folder");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
outputPath = folderPath + "/" + shotCode + "_cmp_TT_" + (apiData.shot.shotVersion || "v001") + "." + extension;
|
||||||
if (queueCompWithOutput(previewComp, templateName, outputPath)) {
|
if (queueCompWithOutput(previewComp, templateName, outputPath)) {
|
||||||
queued += 1;
|
queued += 1;
|
||||||
result.queued += 1;
|
result.queued += 1;
|
||||||
@@ -1323,7 +1345,7 @@ var SETTINGS_KEY = "cfg";
|
|||||||
disableLayerByName(comp, "UNG_VFX_OVERLAY");
|
disableLayerByName(comp, "UNG_VFX_OVERLAY");
|
||||||
disableLayerByName(comp, "_SHOW LUT");
|
disableLayerByName(comp, "_SHOW LUT");
|
||||||
|
|
||||||
folderPath = getShowExportRoot() + "/" + shotCode;
|
folderPath = getShotExportDir(shot);
|
||||||
if (!ensureFolder(folderPath)) {
|
if (!ensureFolder(folderPath)) {
|
||||||
addFailure(result, comp.name, "Could not create output folder");
|
addFailure(result, comp.name, "Could not create output folder");
|
||||||
continue;
|
continue;
|
||||||
@@ -1384,7 +1406,7 @@ var SETTINGS_KEY = "cfg";
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
exportFolder = new Folder(getShowExportRoot() + "/" + shot.shotCode);
|
exportFolder = new Folder(getShotExportDir(shot));
|
||||||
if (!exportFolder.exists) {
|
if (!exportFolder.exists) {
|
||||||
updateStatus(comps.length, "Export folder not found: " + exportFolder.fsName);
|
updateStatus(comps.length, "Export folder not found: " + exportFolder.fsName);
|
||||||
skipped += 1;
|
skipped += 1;
|
||||||
@@ -1596,7 +1618,7 @@ var SETTINGS_KEY = "cfg";
|
|||||||
expectedBaseName = shotCode + "_cmp_TT_" + (shot.shotVersion || "v001");
|
expectedBaseName = shotCode + "_cmp_TT_" + (shot.shotVersion || "v001");
|
||||||
exrOutputBase = shot.exrOutput || "";
|
exrOutputBase = shot.exrOutput || "";
|
||||||
|
|
||||||
sourceFolder = new Folder(getShowExportRoot() + "/" + shotCode);
|
sourceFolder = new Folder(getShotExportDir(shot));
|
||||||
if (!sourceFolder.exists) {
|
if (!sourceFolder.exists) {
|
||||||
addFailure(result, comp.name, "Source export folder not found: " + sourceFolder.fsName);
|
addFailure(result, comp.name, "Source export folder not found: " + sourceFolder.fsName);
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ function isAuthorized(req: NextRequest): boolean {
|
|||||||
//
|
//
|
||||||
// Query params (all optional):
|
// Query params (all optional):
|
||||||
// episode e.g. 108
|
// episode e.g. 108
|
||||||
|
// scene e.g. 022
|
||||||
// sequence e.g. 004
|
// sequence e.g. 004
|
||||||
// status e.g. IN_PROGRESS
|
// status e.g. IN_PROGRESS
|
||||||
// page (default 1)
|
// page (default 1)
|
||||||
@@ -60,6 +61,7 @@ export async function GET(
|
|||||||
where: {
|
where: {
|
||||||
projectId: project.id,
|
projectId: project.id,
|
||||||
...(episode ? { episode } : {}),
|
...(episode ? { episode } : {}),
|
||||||
|
...(scene ? { scene } : {}),
|
||||||
...(sequence ? { sequence } : {}),
|
...(sequence ? { sequence } : {}),
|
||||||
...(status ? { status: status as never } : {}),
|
...(status ? { status: status as never } : {}),
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user