From cf985180551da833d4160afcdf2cb4292e138174 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Tue, 1 Nov 2022 16:09:49 +0100 Subject: Nodes: Add node group assets in add menu This patch builds on the work from bdb57541475f to add node group assets directly in the node editor add menu. Assets are added after separators to distinguish them, but otherwise they look like any other node. The catalog trees from all configured libraries are used to build the menu hierarchy. Only catalogs with matching asset types are used though. There are a few limitations of this initial version. For now this only supports geometry nodes. Support for other built-in node systems just requires some refactoring of the corresponding add menu though. Lazy loading will be added in a followup commit. For now there is a label the first time the menu is opened. Like the search menu integration, re-saving asset library files in 3.4 is required, if it hasn't been done already. Implementation wise, there is a some ugly code here. A lot of that is because the asset system isn't complete. The RNA API doesn't work well yet, and the system isn't built to interact with multiple libraries at once. It's also ugly because of the way we combine automatic menu generation with builtin menus. As noted in a code comment, these two systems could be merged completely so that the menus for builtin nodes are also generated in the same way. Differential Revision: https://developer.blender.org/D16135 --- source/blender/blenkernel/BKE_asset_catalog_path.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/blenkernel/BKE_asset_catalog_path.hh') diff --git a/source/blender/blenkernel/BKE_asset_catalog_path.hh b/source/blender/blenkernel/BKE_asset_catalog_path.hh index 135906dd064..93ab0389daf 100644 --- a/source/blender/blenkernel/BKE_asset_catalog_path.hh +++ b/source/blender/blenkernel/BKE_asset_catalog_path.hh @@ -49,7 +49,7 @@ class AssetCatalogPath { AssetCatalogPath() = default; AssetCatalogPath(StringRef path); - AssetCatalogPath(const std::string &path); + AssetCatalogPath(std::string path); AssetCatalogPath(const char *path); AssetCatalogPath(const AssetCatalogPath &other_path) = default; AssetCatalogPath(AssetCatalogPath &&other_path) noexcept; -- cgit v1.2.3