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
This commit is contained in:
parent
ccf0d22e92
commit
e62a33e572
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue