diff options
author | Lukas Toenne <lukas.toenne@googlemail.com> | 2013-11-12 22:18:06 +0400 |
---|---|---|
committer | Lukas Toenne <lukas.toenne@googlemail.com> | 2013-11-12 22:18:06 +0400 |
commit | 8db4f87546e74c407d3f6eeae73522c9c5996d7a (patch) | |
tree | b10771c2fc1406d191c50352118716fc01e7a52f /release/scripts | |
parent | 4d4ef0434b0078364824c2fe5ebfb8153fb44956 (diff) |
Small example for dynamic node labels in the custom_nodes.py template script.
Diffstat (limited to 'release/scripts')
-rw-r--r-- | release/scripts/templates_py/custom_nodes.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/release/scripts/templates_py/custom_nodes.py b/release/scripts/templates_py/custom_nodes.py index 975ae1881f2..bf89c0debad 100644 --- a/release/scripts/templates_py/custom_nodes.py +++ b/release/scripts/templates_py/custom_nodes.py @@ -109,6 +109,11 @@ class MyCustomNode(Node, MyCustomTreeNode): # 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 |