Blender
V4.3
source
blender
editors
asset
intern
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
17
namespace
blender::ed::asset
{
18
19
bool
id_type_is_non_experimental
(
const
ID
*
id
)
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
26
bool
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
38
return
id_type_is_non_experimental
(
id
);
39
}
40
41
int64_t
types_supported_as_filter_flags
()
42
{
43
if
(
U
.experimental.use_extended_asset_browser) {
44
return
FILTER_ID_ALL
;
45
}
46
47
return
ED_ASSET_TYPE_IDS_NON_EXPERIMENTAL_FLAGS
;
48
}
49
50
}
// namespace blender::ed::asset
BKE_lib_id.hh
BKE_id_can_be_asset
bool BKE_id_can_be_asset(const ID *id)
Definition
lib_id.cc:2438
BLI_utildefines.h
ELEM
#define ELEM(...)
Definition
BLI_utildefines.h:144
FILTER_ID_ALL
#define FILTER_ID_ALL
Definition
DNA_ID.h:1206
ID_NT
@ ID_NT
Definition
DNA_ID_enums.h:141
ID_BR
@ ID_BR
Definition
DNA_ID_enums.h:142
ID_WO
@ ID_WO
Definition
DNA_ID_enums.h:132
ID_MA
@ ID_MA
Definition
DNA_ID_enums.h:124
ID_AC
@ ID_AC
Definition
DNA_ID_enums.h:140
ID_GR
@ ID_GR
Definition
DNA_ID_enums.h:138
ID_OB
@ ID_OB
Definition
DNA_ID_enums.h:120
DNA_userdef_types.h
ED_asset_type.hh
ED_ASSET_TYPE_IDS_NON_EXPERIMENTAL_FLAGS
#define ED_ASSET_TYPE_IDS_NON_EXPERIMENTAL_FLAGS
Definition
ED_asset_type.hh:18
U
unsigned int U
Definition
btGjkEpa3.h:78
GS
#define GS(x)
Definition
iris.cc:202
blender::ed::asset
Definition
ED_asset_catalog.hh:28
blender::ed::asset::types_supported_as_filter_flags
int64_t types_supported_as_filter_flags()
Definition
asset_type.cc:41
blender::ed::asset::id_type_is_non_experimental
bool id_type_is_non_experimental(const ID *id)
Definition
asset_type.cc:19
blender::ed::asset::id_type_is_supported
bool id_type_is_supported(const ID *id)
Definition
asset_type.cc:26
int64_t
__int64 int64_t
Definition
stdint.h:89
ID
Definition
DNA_ID.h:413
Generated on Thu Feb 6 2025 07:36:39 for Blender by
doxygen
1.11.0