diff --git a/scripts/addons_core/node_wrangler/interface.py b/scripts/addons_core/node_wrangler/interface.py index 54a7417e53c..1b71bb7eb5b 100644 --- a/scripts/addons_core/node_wrangler/interface.py +++ b/scripts/addons_core/node_wrangler/interface.py @@ -13,6 +13,18 @@ from .utils.constants import blend_types, geo_combine_operations, operations from .utils.nodes import get_nodes_links, NWBaseMenu +def socket_to_icon(socket): + socket_type = socket.type + + if socket_type == "CUSTOM": + return "RADIOBUT_OFF" + + if socket_type == "VALUE": + socket_type = "FLOAT" + + return "NODE_SOCKET_" + socket_type + + def drawlayout(context, layout, mode='non-panel'): tree_type = context.space_data.tree_type @@ -163,12 +175,15 @@ class NWMergeMixMenu(Menu, NWBaseMenu): class NWConnectionListOutputs(Menu, NWBaseMenu): bl_idname = "NODE_MT_nw_connection_list_out" - bl_label = "From Socket" + bl_label = "" def draw(self, context): layout = self.layout nodes, links = get_nodes_links(context) + layout.label(text="From Socket", icon='RADIOBUT_OFF') + layout.separator() + n1 = nodes[context.scene.NWLazySource] for index, output in enumerate(n1.outputs): # Only show sockets that are exposed. @@ -177,18 +192,21 @@ class NWConnectionListOutputs(Menu, NWBaseMenu): operators.NWCallInputsMenu.bl_idname, text=output.name, text_ctxt=i18n_contexts.default, - icon="RADIOBUT_OFF", + icon=socket_to_icon(output), ).from_socket = index class NWConnectionListInputs(Menu, NWBaseMenu): bl_idname = "NODE_MT_nw_connection_list_in" - bl_label = "To Socket" + bl_label = "" def draw(self, context): layout = self.layout nodes, links = get_nodes_links(context) + layout.label(text="To Socket", icon='FORWARD') + layout.separator() + n2 = nodes[context.scene.NWLazyTarget] for index, input in enumerate(n2.inputs): @@ -200,7 +218,7 @@ class NWConnectionListInputs(Menu, NWBaseMenu): op = layout.operator( operators.NWMakeLink.bl_idname, text=input.name, text_ctxt=i18n_contexts.default, - icon="FORWARD", + icon=socket_to_icon(input), ) op.from_socket = context.scene.NWSourceSocket op.to_socket = index