diff options
author | Bartek Skorupa <bartekskorupa@bartekskorupa.com> | 2014-09-10 18:06:27 +0400 |
---|---|---|
committer | Bartek Skorupa <bartekskorupa@bartekskorupa.com> | 2014-09-10 18:06:27 +0400 |
commit | cd73cfa9f2f6ee044a0a5555c2d9c4cde424fd92 (patch) | |
tree | dbdce3e9cec2b9d9a08ea9bf198648f93a48ddf6 | |
parent | 8093c5fc5e95c8b7a36bbd228d74d94951942edc (diff) |
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.
-rw-r--r-- | node_efficiency_tools.py | 12 |
1 files changed, 8 insertions, 4 deletions
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") |