[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [55507] trunk/blender/release/scripts/ templates_py/custom_nodes.py: Fix for the custom_nodes.py template.
Lukas Toenne
lukas.toenne at googlemail.com
Fri Mar 22 14:17:16 CET 2013
Revision: 55507
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=55507
Author: lukastoenne
Date: 2013-03-22 13:17:16 +0000 (Fri, 22 Mar 2013)
Log Message:
-----------
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.
Modified Paths:
--------------
trunk/blender/release/scripts/templates_py/custom_nodes.py
Modified: trunk/blender/release/scripts/templates_py/custom_nodes.py
===================================================================
--- trunk/blender/release/scripts/templates_py/custom_nodes.py 2013-03-22 13:08:37 UTC (rev 55506)
+++ trunk/blender/release/scripts/templates_py/custom_nodes.py 2013-03-22 13:17:16 UTC (rev 55507)
@@ -37,8 +37,6 @@
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 @@
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.
More information about the Bf-blender-cvs
mailing list