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:
authorMonique Dewanchand <mdewanchand>2022-06-07 16:40:20 +0300
committerHans Goudey <h.goudey@me.com>2022-06-07 16:40:31 +0300
commite62a33e57256cb772e6dfce9ba7a3a58c3c08b0a (patch)
treebef6714a2792e8d9607761be15d9869465a89ef1 /release
parentccf0d22e92ccd3148326477a3e807261c3e9537c (diff)
Nodes: Show node description in Node add menu
Though no nodes have descriptions currently, this patch makes it possible to add descriptions that display in the add menu, for custom node systems and existing builtin nodes. Differential Revision: https://developer.blender.org/D14963
Diffstat (limited to 'release')
-rw-r--r--release/scripts/startup/bl_operators/node.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/release/scripts/startup/bl_operators/node.py b/release/scripts/startup/bl_operators/node.py
index c64898fdfb9..a99a81e0c63 100644
--- a/release/scripts/startup/bl_operators/node.py
+++ b/release/scripts/startup/bl_operators/node.py
@@ -129,6 +129,15 @@ class NodeAddOperator:
return result
+ @classmethod
+ def description(cls, context, properties):
+ nodetype = properties["type"]
+ bl_rna = bpy.types.Node.bl_rna_get_subclass(nodetype)
+ if bl_rna is not None:
+ return bl_rna.description
+ else:
+ return ""
+
# Simple basic operator for adding a node
class NODE_OT_add_node(NodeAddOperator, Operator):