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-03-22 17:17:16 +0400
committerLukas Toenne <lukas.toenne@googlemail.com>2013-03-22 17:17:16 +0400
commita00eda0835ca02c33101984718a85e803cfb4ee2 (patch)
tree7e01467691214a8c5e24ba5f03ce7d01cc93ada7 /release/scripts/templates_py
parent309c487b966fd8e82ae5e03abf1d8e6f57d59b2b (diff)
Fix for the custom_nodes.py template. Socket classes now return their drawing color in a callback instead of a simple property, this makes it possible to change a socket color e.g. based on data type.
Diffstat (limited to 'release/scripts/templates_py')
-rw-r--r--release/scripts/templates_py/custom_nodes.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/release/scripts/templates_py/custom_nodes.py b/release/scripts/templates_py/custom_nodes.py
index 485ee0ebe05..3bcc7f979b3 100644
--- a/release/scripts/templates_py/custom_nodes.py
+++ b/release/scripts/templates_py/custom_nodes.py
@@ -37,8 +37,6 @@ class MyCustomSocket(bpy.types.NodeSocket):
bl_idname = 'CustomSocketType'
# Label for nice name display
bl_label = 'Custom Node Socket'
- # Socket color
- bl_color = (1.0, 0.4, 0.216, 0.5)
# Enum items list
my_items = [
@@ -54,6 +52,9 @@ class MyCustomSocket(bpy.types.NodeSocket):
def draw(self, context, layout, node):
layout.prop(self, "myEnumProperty", text=self.name)
+ # Socket color
+ def draw_color(self, context, node):
+ return (1.0, 0.4, 0.216, 0.5)
# Base class for all custom nodes in this tree type.
# Defines a poll function to enable instantiation.