Blender V4.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
9#include "BLI_utildefines.h"
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_UI_STRING and
22 * #ED_ASSET_TYPE_IDS_NON_EXPERIMENTAL_FLAGS() with this! */
23 return ELEM(GS(id->name), ID_BR, ID_MA, ID_GR, ID_OB, ID_AC, ID_WO, ID_NT);
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 (U.experimental.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 (U.experimental.use_extended_asset_browser) {
44 return FILTER_ID_ALL;
45 }
46
48}
49
50} // namespace blender::ed::asset
bool BKE_id_can_be_asset(const ID *id)
Definition lib_id.cc:2438
#define ELEM(...)
#define FILTER_ID_ALL
Definition DNA_ID.h:1206
@ ID_NT
@ ID_BR
@ ID_WO
@ ID_MA
@ ID_AC
@ ID_GR
@ ID_OB
#define ED_ASSET_TYPE_IDS_NON_EXPERIMENTAL_FLAGS
unsigned int U
Definition btGjkEpa3.h:78
#define GS(x)
Definition iris.cc:202
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
__int64 int64_t
Definition stdint.h:89
Definition DNA_ID.h:413