diff --git a/js/impact-pack.js b/js/impact-pack.js index 86c1ff8..5b8de4b 100644 --- a/js/impact-pack.js +++ b/js/impact-pack.js @@ -319,7 +319,7 @@ app.registerExtension({ if(type == 2) { // connect output - if(connected){ + if(connected && index == 0){ if(nodeData.name == 'ImpactSwitch' && app.graph._nodes_by_id[link_info.target_id].type == 'Reroute') { app.graph._nodes_by_id[link_info.target_id].disconnectInput(link_info.target_slot); } diff --git a/modules/impact/config.py b/modules/impact/config.py index dece2c0..53e44ca 100644 --- a/modules/impact/config.py +++ b/modules/impact/config.py @@ -2,7 +2,7 @@ import configparser import os -version = "V4.12" +version = "V4.12.1" dependency_version = 12 diff --git a/modules/impact/util_nodes.py b/modules/impact/util_nodes.py index bd44ab6..4f3a372 100644 --- a/modules/impact/util_nodes.py +++ b/modules/impact/util_nodes.py @@ -15,14 +15,15 @@ class GeneralSwitch: "hidden": {"unique_id": "UNIQUE_ID", "extra_pnginfo": "EXTRA_PNGINFO"} } - RETURN_TYPES = (any_typ, "STRING", ) - RETURN_NAMES = ("selected_value", "selected_label", ) + RETURN_TYPES = (any_typ, "STRING", "INT") + RETURN_NAMES = ("selected_value", "selected_label", "selected_index") FUNCTION = "doit" CATEGORY = "ImpactPack/Util" def doit(self, *args, **kwargs): - input_name = f"input{int(kwargs['select'])}" + selected_index = int(kwargs['select']) + input_name = f"input{selected_index}" selected_label = input_name node_id = kwargs['unique_id'] @@ -38,10 +39,10 @@ class GeneralSwitch: break if input_name in kwargs: - return (kwargs[input_name], selected_label) + return (kwargs[input_name], selected_label, selected_index) else: print(f"ImpactSwitch: invalid select index (ignored)") - return (None, "") + return (None, "", selected_index) class GeneralInversedSwitch: