Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2021-10-23 00:56:05 +0300
committerJulian Eisel <julian@blender.org>2021-10-23 00:56:05 +0300
commitcfc64261c12e90bf3219cb377d4fe7c008407850 (patch)
tree34f9c727d12991d50b1560ac2a2081f56a2ac4fe /source/blender/editors/asset
parentc51eac24fea8e010a8fed84f5f8787521067fb42 (diff)
Asset Browser: Filter options for specific ID types
Adds a filter popup to the header that allows specifiying which data-block types to show. The menu automatically reflects all supported ID types, so it shows a checkbox for materials, worlds and actions currently by default, and all ID types with the "Extended Asset Browser" experimental feature enabled.
Diffstat (limited to 'source/blender/editors/asset')
-rw-r--r--source/blender/editors/asset/ED_asset_type.h3
-rw-r--r--source/blender/editors/asset/intern/asset_type.cc8
2 files changed, 5 insertions, 6 deletions
diff --git a/source/blender/editors/asset/ED_asset_type.h b/source/blender/editors/asset/ED_asset_type.h
index 1030be1ea05..5629ae189c0 100644
--- a/source/blender/editors/asset/ED_asset_type.h
+++ b/source/blender/editors/asset/ED_asset_type.h
@@ -20,6 +20,8 @@
#pragma once
+#include "DNA_ID.h"
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -27,6 +29,7 @@ extern "C" {
struct ID;
bool ED_asset_type_id_is_non_experimental(const struct ID *id);
+#define ED_ASSET_TYPE_IDS_NON_EXPERIMENTAL_FLAGS (FILTER_ID_MA | FILTER_ID_AC | FILTER_ID_WO)
/**
* Check if the asset type for \a id (which doesn't need to be an asset right now) can be an asset,
diff --git a/source/blender/editors/asset/intern/asset_type.cc b/source/blender/editors/asset/intern/asset_type.cc
index 5be627e3fbc..cdff538a712 100644
--- a/source/blender/editors/asset/intern/asset_type.cc
+++ b/source/blender/editors/asset/intern/asset_type.cc
@@ -29,13 +29,9 @@
bool ED_asset_type_id_is_non_experimental(const ID *id)
{
/* Remember to update #ED_ASSET_TYPE_IDS_NON_EXPERIMENTAL_UI_STRING and
- * #asset_type_ids_non_experimental_as_filter_flags() with this! */
+ * #ED_ASSET_TYPE_IDS_NON_EXPERIMENTAL_FLAGS() with this! */
return ELEM(GS(id->name), ID_MA, ID_AC, ID_WO);
}
-static int64_t asset_type_ids_non_experimental_as_filter_flags()
-{
- return FILTER_ID_MA | FILTER_ID_AC | FILTER_ID_WO;
-}
bool ED_asset_type_is_supported(const ID *id)
{
@@ -58,5 +54,5 @@ int64_t ED_asset_types_supported_as_filter_flags()
return FILTER_ID_ALL;
}
- return asset_type_ids_non_experimental_as_filter_flags();
+ return ED_ASSET_TYPE_IDS_NON_EXPERIMENTAL_FLAGS;
}