Commit: e62a33e57256cb772e6dfce9ba7a3a58c3c08b0a Author: Monique Dewanchand Date: Tue Jun 7 15:40:20 2022 +0200 Branches: master https://developer.blender.org/rBe62a33e57256cb772e6dfce9ba7a3a58c3c08b0a
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 =================================================================== M release/scripts/startup/bl_operators/node.py =================================================================== 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): _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs