From e62a33e57256cb772e6dfce9ba7a3a58c3c08b0a Mon Sep 17 00:00:00 2001 From: Monique Dewanchand Date: Tue, 7 Jun 2022 15:40:20 +0200 Subject: [PATCH] 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 --- release/scripts/startup/bl_operators/node.py | 9 +++++++++ 1 file changed, 9 insertions(+) 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):