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:
@@ -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");
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user