[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [61238] trunk/blender/release/scripts/ templates_py/custom_nodes.py: Small example for dynamic node labels in the custom_nodes. py template script.

Lukas Toenne lukas.toenne at googlemail.com
Tue Nov 12 19:18:06 CET 2013


Revision: 61238
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=61238
Author:   lukastoenne
Date:     2013-11-12 18:18:06 +0000 (Tue, 12 Nov 2013)
Log Message:
-----------
Small example for dynamic node labels in the custom_nodes.py template script.

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-11-12 18:18:04 UTC (rev 61237)
+++ trunk/blender/release/scripts/templates_py/custom_nodes.py	2013-11-12 18:18:06 UTC (rev 61238)
@@ -109,7 +109,12 @@
         # myStringProperty button will only be visible in the sidebar
         layout.prop(self, "myStringProperty")
 
+    # Optional: custom label
+    # Explicit user label overrides this, but here we can define a label dynamically
+    def draw_label(self):
+        return "I am a custom node"
 
+
 ### Node Categories ###
 # Node categories are a python system for automatically
 # extending the Add menu, toolbar panels and search operator.




More information about the Bf-blender-cvs mailing list