diff options
author | Hans Goudey <h.goudey@me.com> | 2022-09-19 19:57:10 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-09-19 19:57:10 +0300 |
commit | bdb57541475f20ccc4f6e5f8fc075ac424becc19 (patch) | |
tree | b09f860cedf50ccbf6b1234d0b1d414944ff1525 /source/blender/editors/space_node/node_intern.hh | |
parent | 862de9187f1b914358c33dd9700e338f0174bbf0 (diff) |
Nodes: Add node group assets to search menus
Currently node group assets are supported, but using them by dragging
from the asset browser is cumbersome. This patch adds all node group
assets from user asset libraries and the current file libraries to the
add node search menu and the link drag search menu.
Node groups added through the search will have their "options" hidden,
meaning the data-block selector is displayed. This helps keep the UI
clean, and the selector shouldn't be necessary anyway.
To make that possible, metadata like the node tree type and its inputs
and outputs has to be saved in the file. This requires re-saving the
files that contain the assets with the patch applied.
The node add search operator is moved from Python to C++ to ease
development and allow more flexibility. It supports a tooltip that
gives the description of assets.
Currently the node groups are added with the asset system's existing
"Append & Reuse" behavior. It's likely that linking should be possible
in the future too, but for now the idea is to use the more foolproof
option that doesn't create dependencies between files.
Because loading assets can potentially take a long time, the search
menu refreshes its items as new assets are loaded. However, changing
the search field is necessary to see the update.
Differential Revision: https://developer.blender.org/D15568
Diffstat (limited to 'source/blender/editors/space_node/node_intern.hh')
-rw-r--r-- | source/blender/editors/space_node/node_intern.hh | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/editors/space_node/node_intern.hh b/source/blender/editors/space_node/node_intern.hh index 456cbf5064d..70ac0e48d01 100644 --- a/source/blender/editors/space_node/node_intern.hh +++ b/source/blender/editors/space_node/node_intern.hh @@ -251,6 +251,7 @@ bNode *add_node(const bContext &C, StringRef idname, const float2 &location); bNode *add_static_node(const bContext &C, int type, const float2 &location); void NODE_OT_add_reroute(wmOperatorType *ot); +void NODE_OT_add_search(wmOperatorType *ot); void NODE_OT_add_group(wmOperatorType *ot); void NODE_OT_add_object(wmOperatorType *ot); void NODE_OT_add_collection(wmOperatorType *ot); @@ -375,4 +376,8 @@ void invoke_node_link_drag_add_menu(bContext &C, bNodeSocket &socket, const float2 &cursor); +/* add_node_search.cc */ + +void invoke_add_node_search_menu(bContext &C, const float2 &cursor, bool use_transform); + } // namespace blender::ed::space_node |