diff options
author | Wannes Malfait <Wannes> | 2022-07-05 17:20:31 +0300 |
---|---|---|
committer | Jacques Lucke <mail@jlucke.com> | 2022-07-05 17:20:31 +0300 |
commit | b2d470058ebffa59c5fdd87ff4f129bd3f17120c (patch) | |
tree | 6eec96945e85a7e7f1462281fd404f2a9f9c2955 /node_wrangler.py | |
parent | 0d1a3cc2430efe46cd5f4b224a29f17133947283 (diff) |
Fix T94290: node wrangler misconnects some nodes
Differential Revision: https://developer.blender.org/D15373
Diffstat (limited to 'node_wrangler.py')
-rw-r--r-- | node_wrangler.py | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/node_wrangler.py b/node_wrangler.py index 1a815dc6..206399cb 100644 --- a/node_wrangler.py +++ b/node_wrangler.py @@ -4417,12 +4417,10 @@ class NWConnectionListOutputs(Menu, NWBase): nodes, links = get_nodes_links(context) n1 = nodes[context.scene.NWLazySource] - index=0 - for o in n1.outputs: + for index, output in enumerate(n1.outputs): # Only show sockets that are exposed. - if o.enabled: - layout.operator(NWCallInputsMenu.bl_idname, text=o.name, icon="RADIOBUT_OFF").from_socket=index - index+=1 + if output.enabled: + layout.operator(NWCallInputsMenu.bl_idname, text=output.name, icon="RADIOBUT_OFF").from_socket=index class NWConnectionListInputs(Menu, NWBase): @@ -4435,17 +4433,15 @@ class NWConnectionListInputs(Menu, NWBase): n2 = nodes[context.scene.NWLazyTarget] - index = 0 - for i in n2.inputs: + for index, input in enumerate(n2.inputs): # Only show sockets that are exposed. # This prevents, for example, the scale value socket # of the vector math node being added to the list when # the mode is not 'SCALE'. - if i.enabled: - op = layout.operator(NWMakeLink.bl_idname, text=i.name, icon="FORWARD") + if input.enabled: + op = layout.operator(NWMakeLink.bl_idname, text=input.name, icon="FORWARD") op.from_socket = context.scene.NWSourceSocket op.to_socket = index - index+=1 class NWMergeMathMenu(Menu, NWBase): |