UI: Region polling support #105088

Merged
Julian Eisel merged 39 commits from JulianEisel/blender:temp-region-poll into main 2023-04-05 15:30:46 +02:00
1 changed files with 8 additions and 25 deletions
Showing only changes of commit 11abc1be39 - Show all commits

View File

@ -93,12 +93,15 @@ static void search_items_for_asset_metadata(const bNodeTree &node_tree,
search_items.append(std::move(item));
}
static void gather_search_items_for_asset_library(const bContext &C,
const bNodeTree &node_tree,
const AssetLibraryReference &library_ref,
Set<std::string> &r_added_assets,
Vector<AddNodeItem> &search_items)
static void gather_search_items_for_all_assets(const bContext &C,
const bNodeTree &node_tree,
Set<std::string> &r_added_assets,
Vector<AddNodeItem> &search_items)
{
AssetLibraryReference library_ref{};
library_ref.custom_library_index = -1;
library_ref.type = ASSET_LIBRARY_ALL;
AssetFilterSettings filter_settings{};
filter_settings.id_types = FILTER_ID_NT;
@ -117,26 +120,6 @@ static void gather_search_items_for_asset_library(const bContext &C,
});
}
static void gather_search_items_for_all_assets(const bContext &C,
const bNodeTree &node_tree,
Set<std::string> &r_added_assets,
Vector<AddNodeItem> &search_items)
{
int i;
LISTBASE_FOREACH_INDEX (const bUserAssetLibrary *, asset_library, &U.asset_libraries, i) {
AssetLibraryReference library_ref{};
library_ref.custom_library_index = i;
library_ref.type = ASSET_LIBRARY_CUSTOM;
/* Skip local assets to avoid duplicates when the asset is part of the local file library. */
gather_search_items_for_asset_library(C, node_tree, library_ref, r_added_assets, search_items);
}
AssetLibraryReference library_ref{};
library_ref.custom_library_index = -1;
library_ref.type = ASSET_LIBRARY_LOCAL;
gather_search_items_for_asset_library(C, node_tree, library_ref, r_added_assets, search_items);
}
static void gather_search_items_for_node_groups(const bContext &C,
const bNodeTree &node_tree,
const Set<std::string> &local_assets,