From cd73cfa9f2f6ee044a0a5555c2d9c4cde424fd92 Mon Sep 17 00:00:00 2001 From: Bartek Skorupa Date: Wed, 10 Sep 2014 16:06:27 +0200 Subject: Fixed some classes when all sockets are hidden In "Link to Output Node" and in "Emission Viewer" when all output sockets are hidden - an error occurred. Now it's fixed. --- node_efficiency_tools.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'node_efficiency_tools.py') diff --git a/node_efficiency_tools.py b/node_efficiency_tools.py index cd81b7e0..375bff22 100644 --- a/node_efficiency_tools.py +++ b/node_efficiency_tools.py @@ -1391,7 +1391,10 @@ class NWEmissionViewer(Operator, NWBase): valid = False if active: if (active.name != "Emission Viewer") and (active.type not in output_types) and not in_group: - valid = True + for out in active.outputs: + if not out.hide: + valid = True + break if valid: # get material_output node, store selection, deselect all materialout_exists = False @@ -2651,7 +2654,10 @@ class NWLinkToOutputNode(Operator, NWBase): valid = False if nw_check(context): if context.active_node is not None: - valid = True + for out in context.active_node.outputs: + if not out.hide: + valid = True + break return valid def execute(self, context): @@ -3039,8 +3045,6 @@ class NWConnectionListInputs(Menu, NWBase): n2 = nodes[context.scene.NWLazyTarget] - #print (self.from_socket) - index = 0 for i in n2.inputs: op = layout.operator(NWMakeLink.bl_idname, text=i.name, icon="FORWARD") -- cgit v1.2.3