Blender V5.3
asset_type.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include "BLI_utildefines.hh"
10
11#include "DNA_userdef_types.h"
12
13#include "BKE_lib_id.hh"
14
15#include "ED_asset_type.hh"
16
17namespace blender::ed::asset {
18
20{
21 /* Remember to update #ED_ASSET_TYPE_IDS_NON_EXPERIMENTAL_FLAGS() and the messages in
22 * asset_operation_unsupported_type_msg with this! */
23 return ELEM(GS(id->name), ID_BR, ID_MA, ID_GR, ID_OB, ID_AC, ID_WO, ID_NT, ID_SCE);
24}
25
26bool id_type_is_supported(const ID *id)
27{
28 if (!BKE_id_can_be_asset(id)) {
29 return false;
30 }
31
32 if (USER_EXPERIMENTAL_TEST(&U, use_extended_asset_browser)) {
33 /* The "Extended Asset Browser" experimental feature flag enables all asset types that can
34 * technically be assets. */
35 return true;
36 }
37
39}
40
42{
43 if (USER_EXPERIMENTAL_TEST(&U, use_extended_asset_browser)) {
44 return FILTER_ID_ALL;
45 }
46
48}
49
50} // namespace blender::ed::asset
#define FILTER_ID_ALL
Definition DNA_ID.h:1241
#define USER_EXPERIMENTAL_TEST(userdef, member)
#define ED_ASSET_TYPE_IDS_NON_EXPERIMENTAL_FLAGS
#define ELEM(...)
int64_t types_supported_as_filter_flags()
Definition asset_type.cc:41
bool id_type_is_non_experimental(const ID *id)
Definition asset_type.cc:19
bool id_type_is_supported(const ID *id)
Definition asset_type.cc:26
UserDef U
Definition blender.cc:58
__int64 int64_t
Definition BKE_text.h:90
ID_Type GS(const char *name)
Definition DNA_ID.h:410
bool BKE_id_can_be_asset(const ID *id)
Definition lib_id.cc:2764