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:
authorLukas Toenne <lukas.toenne@googlemail.com>2013-05-08 20:17:04 +0400
committerLukas Toenne <lukas.toenne@googlemail.com>2013-05-08 20:17:04 +0400
commita3c82d4cdec19c4c61e1f6c5416f7216cf23bba3 (patch)
tree8bff6299182598216cfea86f5010c84680cc7631 /release/scripts/templates_py
parent8deba334977d13c83dee1fb9a54c4fe15c252918 (diff)
Updated the custom_nodes.py template script to reflect socket draw API changes in r56584 and r56585.
Diffstat (limited to 'release/scripts/templates_py')
-rw-r--r--release/scripts/templates_py/custom_nodes.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/release/scripts/templates_py/custom_nodes.py b/release/scripts/templates_py/custom_nodes.py
index 3bcc7f979b3..a07d5173825 100644
--- a/release/scripts/templates_py/custom_nodes.py
+++ b/release/scripts/templates_py/custom_nodes.py
@@ -49,8 +49,11 @@ class MyCustomSocket(bpy.types.NodeSocket):
myEnumProperty = bpy.props.EnumProperty(name="Direction", description="Just an example", items=my_items, default='UP')
# Optional function for drawing the socket input value
- def draw(self, context, layout, node):
- layout.prop(self, "myEnumProperty", text=self.name)
+ def draw(self, context, layout, node, text):
+ if self.is_linked:
+ layout.label(text)
+ else:
+ layout.prop(self, "myEnumProperty", text=text)
# Socket color
def draw_color(self, context, node):