31 if (
filter->id_types && (
filter->id_types & asset_id_filter) == 0) {
40 if (matched_tag ==
nullptr) {
58 if (!is_asset_visible_fn(
asset)) {
69 if (catalog ==
nullptr) {
78 const std::shared_ptr<const asset_system::AssetCatalogTree> full_tree =
79 library.catalog_service().catalog_tree();
87 if (catalog ==
nullptr) {
90 filtered_tree.insert_item(*catalog);
99 const bool has_skip_prefix = skip_prefix && full_path.
str().starts_with(*skip_prefix) &&
100 full_path.
str()[skip_prefix->size()] ==
103 return has_skip_prefix ?
StringRef(full_path.
str()).drop_prefix(skip_prefix->size() + 1) :
112 const std::optional<StringRef> skip_prefix)
125 const bool dirty = !loading_finished;
132 if (meta_data_filter && !meta_data_filter(meta_data)) {
143 if (catalog ==
nullptr) {
153 if (catalog_path.
str().empty() ||
154 catalog_path.
str() == std::string{asset_system::AssetCatalogPath::SEPARATOR})
162 assets_per_path.
add(catalog_path, &
asset);
167 const std::shared_ptr<const asset_system::AssetCatalogTree> catalog_tree =
168 library->catalog_service().catalog_tree();
173 if (assets_per_path.
lookup(catalog_path).is_empty()) {
178 if (catalog ==
nullptr) {
181 catalogs_with_node_assets.insert_item(*catalog, skip_prefix);
184 return {std::move(catalogs_with_node_assets),
185 std::move(assets_per_path),
186 std::move(unassigned_assets),
Main runtime representation of an asset.
Span< Value > lookup(const Key &key) const
void add(const Key &key, const Value &value)
bool contains(const Key &key) const
void append(const T &value)
const std::string & str() const
static const char SEPARATOR
AssetCatalogPath catalog_path() const
CatalogID get_catalog_id() const
void storage_fetch(const AssetLibraryReference *library_reference, const bContext *C)
void iterate(const AssetLibraryReference &library_reference, AssetListIterFn fn)
asset_system::AssetLibrary * library_get_once_available(const AssetLibraryReference &library_reference)
bool is_loaded(const AssetLibraryReference *library_reference)
bool filter_matches_asset(const AssetFilterSettings *filter, const asset_system::AssetRepresentation &asset)
static asset_system::AssetCatalogPath catalog_path_skipped_prefix(const asset_system::AssetCatalogPath &full_path, const std::optional< StringRef > skip_prefix)
AssetItemTree build_filtered_all_catalog_tree(const AssetLibraryReference &library_ref, const bContext &C, const AssetFilterSettings &filter_settings, FunctionRef< bool(const AssetMetaData &)> meta_data_filter={}, const std::optional< StringRef > skip_prefix=std::nullopt)
asset_system::AssetCatalogTree build_filtered_catalog_tree(const asset_system::AssetLibrary &library, const AssetLibraryReference &library_ref, FunctionRef< bool(const asset_system::AssetRepresentation &)> is_asset_visible_fn)
uint64_t BKE_idtype_idcode_to_idfilter(short idcode)
unsigned __int64 uint64_t
bool BLI_uuid_is_nil(bUUID uuid)
void * BLI_findstring(const ListBase *listbase, const char *id, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
User defined tag. Currently only used by assets, could be used more often at some point....