UI/Nodes: Adding node groups via drag & drop (e.g. from Asset Browser)

Adds `NODE_OT_add_group` operator to add a node group from a given name, and
uses that to register a node editor drop-box.
When dropping a node-group asset, the ID will be appended. This is what we do
for other ID assets too.

Should the node group insertion fail (e.g. the group is not compatible with the
current tree, as checked by the poll), the appended data-block is removed.

Differential Revision: https://developer.blender.org/D10405

Reviewed by: Jacques Lucke
This commit is contained in:
2021-02-15 19:35:24 +01:00
parent 45852532d5
commit 604e61d81d
5 changed files with 133 additions and 5 deletions

View File

@@ -88,6 +88,7 @@ void node_operatortypes(void)
WM_operatortype_append(NODE_OT_backimage_fit);
WM_operatortype_append(NODE_OT_backimage_sample);
WM_operatortype_append(NODE_OT_add_group);
WM_operatortype_append(NODE_OT_add_file);
WM_operatortype_append(NODE_OT_add_mask);