From 3bbcea179be8155ba52eaf89fd64e1897980c845 Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 25 Sep 2025 09:55:57 +1000 Subject: [PATCH] bugs --- .vscode/settings.json | 5 ++++ js/connections.js | 14 ++++++++--- js/use_everywhere.js | 4 +-- js/use_everywhere_graph_analysis.js | 1 + js/use_everywhere_utilities.js | 39 ++++++++++++++++------------- 5 files changed, 40 insertions(+), 23 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..a8c2003 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "python-envs.defaultEnvManager": "ms-python.python:conda", + "python-envs.defaultPackageManager": "ms-python.python:conda", + "python-envs.pythonProjects": [] +} \ No newline at end of file diff --git a/js/connections.js b/js/connections.js index af04d34..eaf0238 100644 --- a/js/connections.js +++ b/js/connections.js @@ -35,7 +35,12 @@ export function input_changed(node, slot, connect, link_info) { if (connect) { const type = get_type(node, link_info) if (app.ui.settings.getSettingValue("Use Everywhere.Options.use_output_name") && link_info) { - const out_slot = node.graph.getNodeById(link_info.origin_id)?.outputs[link_info.origin_slot] + var out_slot + if (link_info.origin_id==-10) { + out_slot = node.graph.inputNode?.allSlots[link_info.origin_slot] + } else { + out_slot = node.graph.getNodeById(link_info.origin_id)?.outputs[link_info.origin_slot] + } node.inputs[slot].label = out_slot?.label || out_slot?.localized_name || out_slot?.name || i18n(type); } else { node.inputs[slot].label = i18n(type); @@ -47,7 +52,7 @@ export function input_changed(node, slot, connect, link_info) { node.inputs[slot].color_on = undefined; node.inputs[slot].type = '*' } - fix_inputs(node, "input_changed") + } @@ -88,9 +93,12 @@ This is called in various places (node load, creation, link change) to ensure th var fix_call_message; function fix_star_inputs(node) { + node.inputs.filter((input)=>(!input.link)).forEach((input)=>{ + input.type = '*' + }) node.inputs.filter((input)=>(input.type=='*' && input.link)).forEach((input)=>{ const llink = node.graph.links[input.link] - if (llink.type) input.type = llink + if (llink.type) input.type = llink.type }) } diff --git a/js/use_everywhere.js b/js/use_everywhere.js index 3759356..952911d 100644 --- a/js/use_everywhere.js +++ b/js/use_everywhere.js @@ -67,14 +67,12 @@ app.registerExtension({ if (this.IS_UE && side==1) { // side 1 is input input_changed(this, slot, connect, link_info) - // I suspect this is no longer needed... in which case the whole Deferred can be dumped! if (!shared.graph_being_configured) { // do the fix at the end of graph change - deferred_actions.push( { fn:fix_inputs, args:[this,"deferred",]} ) + deferred_actions.push( { fn:fix_inputs, args:[this,"deferred onConnectionsChange",]} ) // disconnecting doesn't trigger graphChange call? setTimeout(deferred_actions.execute.bind(deferred_actions), 100) } - // ...to here } linkRenderController?.mark_link_list_outdated(); onConnectionsChange?.apply(this, arguments); diff --git a/js/use_everywhere_graph_analysis.js b/js/use_everywhere_graph_analysis.js index f542be1..c9d82ce 100644 --- a/js/use_everywhere_graph_analysis.js +++ b/js/use_everywhere_graph_analysis.js @@ -84,6 +84,7 @@ class GraphAnalyser extends Pausable { if (node && !node.properties.rejects_ue_links) { //if (!real_node._widget_name_map) real_node._widget_name_map = real_node.widgets?.map(w => w.name) || []; node.inputs?.forEach((input,index) => { + if (!input) return; // NoteNode has input = [undefined,] ! if (is_connected(input, treat_bypassed_as_live, node_graph(node))) return; if (node.reject_ue_connection && node.reject_ue_connection(input)) return; if (is_connectable(node, input.name)) connectable.push({node, input, index}); diff --git a/js/use_everywhere_utilities.js b/js/use_everywhere_utilities.js index c7e10be..7fd793e 100644 --- a/js/use_everywhere_utilities.js +++ b/js/use_everywhere_utilities.js @@ -133,29 +133,34 @@ class GraphConverter { } } // fix the localized names - node.inputs = node.inputs.map((input) => { - if (!input.localized_name || input.localized_name.startsWith(i18n('anything'))) input.localized_name = input.name - return input; + node.inputs = node.inputs.forEach((input) => { + if (input) { + if (!input.localized_name || input.localized_name.startsWith(i18n('anything'))) input.localized_name = input.name + } else { + let brteakpoint; + } }) // set types to match - node.inputs.forEach((input) => { - if (input.type=='*') { - const graph = node_graph(node); - if (input.link) { - const llink = graph.links[input.link]; - if (link_is_from_subgraph_input(llink)) { - input.type = get_subgraph_input_type(graph, llink.origin_slot); + if (node.inputs) { + node.inputs.forEach((input) => { + if (input.type=='*') { + const graph = node_graph(node); + if (input.link) { + const llink = graph.links[input.link]; + if (link_is_from_subgraph_input(llink)) { + input.type = get_subgraph_input_type(graph, llink.origin_slot); + } else { + input.type = llink.type; + } } else { - input.type = llink.type; + input.type = (input.label && input.label!=i18n('anything')) ? input.label : input.name } - } else { - input.type = (input.label && input.label!=i18n('anything')) ? input.label : input.name } - } - }); + }); - Logger.log_detail(`clean_ue_node ${node.id} (${node.type})`, node.inputs); + Logger.log_detail(`clean_ue_node ${node.id} (${node.type})`, node.inputs); + } } convert_if_pre_116(node) { @@ -335,7 +340,7 @@ export function get_connection(node, i) { const in_link = node?.inputs[i]?.link; if (in_link) { var llink = graph.links[in_link] - llink = handle_bypass(llink, llink.type) + llink = handle_bypass(llink, llink.type, graph) if (!llink) { Logger.log_problem(`handle_bypass failing - subgraph issue?`) llink = graph.links[in_link]