From 4929db45a25cce3117b7d50c6481af9fecc8562d Mon Sep 17 00:00:00 2001 From: twotalesanimation <80506065+twotalesanimation@users.noreply.github.com> Date: Thu, 13 Aug 2026 19:20:14 +0200 Subject: [PATCH] fix(connector): try every matching path mapping, not just the first MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A studio whose render output root changed carries both conventions in the database permanently — changing render.outputRoot only affects new exports, so old rows keep the path they were queued with. On UNG that is //SAN/renders/{projectCode}/... for older exports and //SAN/{showId}/... for current ones, living side by side under one Export Root. applyPathMappings returned only the first prefix match, so one rewrite had to serve both and could not. It now returns every match and resolveServerPath tests each for existence, which is what the candidate ordering was there for. Verified against the live drive: with "//SAN/=V:/_EXPORTS/UNG/" the legacy export resolves via the mapping and current ones via the Export Root re-base; with both rewrites mapped, all three resolve directly. Panel 2.1.1. Co-Authored-By: Claude Opus 5 --- VFXReviewConnector.jsx | 15 ++++++++++----- VFXReviewConnector.md | 21 ++++++++++++++++++--- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/VFXReviewConnector.jsx b/VFXReviewConnector.jsx index c208c58..1589773 100644 --- a/VFXReviewConnector.jsx +++ b/VFXReviewConnector.jsx @@ -27,7 +27,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.1.0"; +var PANEL_VERSION = "2.1.1"; (function VFXReviewConnector(thisObj) { var uiState = { @@ -828,17 +828,22 @@ var PANEL_VERSION = "2.1.0"; return mappings; } + // Returns *every* rewrite whose prefix matches, not just the first: a shop + // with more than one on-disk convention (an old export root and a current + // one) can map the same prefix twice, and resolveServerPath picks whichever + // candidate actually exists. function applyPathMappings(path) { var mappings = parsePathMappings(); var normalized = normalizeSlashes(path); + var results = []; var i; for (i = 0; i < mappings.length; i += 1) { if (normalized.toLowerCase().indexOf(mappings[i].from.toLowerCase()) === 0) { - return mappings[i].to + normalized.substring(mappings[i].from.length); + results.push(mappings[i].to + normalized.substring(mappings[i].from.length)); } } - return null; + return results; } // Re-base a server path onto Export Root from the show folder down, which @@ -874,8 +879,8 @@ var PANEL_VERSION = "2.1.0"; var rebased; var i; - if (mapped) { - candidates.push({ path: mapped, how: "path mapping" }); + for (i = 0; i < mapped.length; i += 1) { + candidates.push({ path: mapped[i], how: "path mapping" }); } candidates.push({ path: normalizeSlashes(serverPath), how: "server path" }); diff --git a/VFXReviewConnector.md b/VFXReviewConnector.md index 8e2da80..80d732b 100644 --- a/VFXReviewConnector.md +++ b/VFXReviewConnector.md @@ -36,9 +36,24 @@ It resolves this itself in most cases, trying in order: from the show folder down (`{root}/{showId}/{episode}/{shot}/{version}`), so the tail is simply re-attached to Export Root. -Step 3 is why this usually needs no configuration. Set Path Mappings only when -the two layouts genuinely differ. **Diagnostics** checks this against a real -render folder from the QC queue and names every path it tried when it fails. +Step 3 is why this usually needs no configuration. **Diagnostics** checks the +whole thing against a real render folder from the QC queue and names every path +it tried when it fails. + +### More than one on-disk convention + +Every candidate is tested for existence and the first that resolves wins, so a +studio whose output root changed at some point can map the **same prefix more +than once** and let the panel work out which applies per export: + +``` +//SAN/=V:/_EXPORTS/;//SAN/=V:/_EXPORTS/UNG/ +``` + +Older exports keep whatever path was stored on them when they were queued — +changing `render.outputRoot` on the server only affects new ones — so mixed +conventions in one database are normal and permanent. Add a mapping per +convention rather than trying to make one rewrite cover them all. ---