Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2020-10-19 13:28:44 +0300
committerJacques Lucke <jacques@blender.org>2020-10-19 13:28:44 +0300
commit93887d10961a65843f8e70d7d4f5a1b64aba46b5 (patch)
treeefb231304aa626fadd9e1d8ff3612a7237092db3
parentf7832b1583cd13bde182192bce358db3062a0547 (diff)
Fix: skip drawing input sockets that do not have a draw method
Contributed by @povmaniaco with minor changes by me. Differential Revision: https://developer.blender.org/D9263
-rw-r--r--release/scripts/startup/bl_ui/space_node.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py
index 4662de8b4ac..c0c38c02c63 100644
--- a/release/scripts/startup/bl_ui/space_node.py
+++ b/release/scripts/startup/bl_ui/space_node.py
@@ -537,7 +537,7 @@ class NODE_PT_active_node_properties(Panel):
# XXX this could be filtered further to exclude socket types
# which don't have meaningful input values (e.g. cycles shader)
- value_inputs = [socket for socket in node.inputs if socket.enabled and not socket.is_linked]
+ value_inputs = [socket for socket in node.inputs if self.show_socket_input(socket)]
if value_inputs:
layout.separator()
layout.label(text="Inputs:")
@@ -550,6 +550,9 @@ class NODE_PT_active_node_properties(Panel):
iface_(socket.label if socket.label else socket.name, socket.bl_rna.translation_context),
)
+ def show_socket_input(self, socket):
+ return hasattr(socket, 'draw') and socket.enabled and not socket.is_linked
+
class NODE_PT_texture_mapping(Panel):
bl_space_type = 'NODE_EDITOR'