Fix JS extension loading errors (closes #13, partial #10)

Remove non-existent load_exr.js import that broke all JS extensions.
Fix isCryptomatte scope bug in setup() causing ReferenceError.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
CoCo
2026-02-20 15:07:19 +00:00
co-authored by Claude Opus 4.6
parent 1c54512104
commit 7f6e2d5fea
2 changed files with 13 additions and 12 deletions
-1
View File
@@ -1,6 +1,5 @@
// CoCoTools_IO JavaScript Extensions Entry Point
import "./saver.js";
import "./load_exr.js";
import "./load_exr_layer_by_name.js";
console.log("CoCoTools_IO extensions loaded successfully");
+13 -11
View File
@@ -241,31 +241,33 @@ app.registerExtension({
// Listen for graph execution
app.addEventListener("graphExecuted", (e) => {
try {
// Get all matched nodes
const matchedNodes = findNodes(isCryptomatte ? "CryptomatteLayer" : "LoadExrLayerByName");
if (matchedNodes.length === 0) {
// Find both node types independently
const layerNodes = findNodes("LoadExrLayerByName");
const cryptoNodes = findNodes("CryptomatteLayer");
const allNodes = [...layerNodes, ...cryptoNodes];
if (allNodes.length === 0) {
return; // No nodes to update
}
console.log(`Found ${matchedNodes.length} ${isCryptomatte ? "cryptomatte " : ""}layer nodes to update after execution`);
console.log(`Found ${layerNodes.length} layer nodes and ${cryptoNodes.length} cryptomatte nodes to update after execution`);
// For each node, call updateLayerOptions
for (const node of matchedNodes) {
for (const node of allNodes) {
if (node.updateLayerOptions) {
node.updateLayerOptions();
}
}
} catch (error) {
console.error(`Error in ${isCryptomatte ? "cryptomatte " : ""}layer node graph execution handler:`, error);
console.error("Error in layer node graph execution handler:", error);
}
});
function findNodes(type) {
if (!app.graph || !app.graph._nodes) {
return [];
}
return app.graph._nodes.filter(node => node.type === type);
}
}