diff options
author | Jeroen Bakker <jbakker> | 2022-02-11 10:23:52 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2022-02-11 10:24:33 +0300 |
commit | bccdb143db1319a8c7e6df86767513f728c9c86f (patch) | |
tree | c2f9c3d199120dbc7b52fa47914e361fc92a6372 /source/blender/blenkernel/BKE_lib_query.h | |
parent | 9118cdfff3fa0a375d7ee25e9fb81e4af371cc02 (diff) |
Refactoring of `BKE_library_id_can_use_idtype` to use filter_id.
For an upcoming project we would want to match multiple id types in a
single go. To not replicate the implementation using other types we
introduce `BKE_library_id_can_use_filter_id` that returns all supported
types as a filter.
Not all ID types have a filter_id (ID_LI, ID_KE, ID_SCR) These
exceptions are not available in the filter_id function.
Reviewed By: mont29
Maniphest Tasks: T95279
Differential Revision: https://developer.blender.org/D14061
Diffstat (limited to 'source/blender/blenkernel/BKE_lib_query.h')
-rw-r--r-- | source/blender/blenkernel/BKE_lib_query.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_lib_query.h b/source/blender/blenkernel/BKE_lib_query.h index 09d52dd9c62..926be9c7dbe 100644 --- a/source/blender/blenkernel/BKE_lib_query.h +++ b/source/blender/blenkernel/BKE_lib_query.h @@ -18,6 +18,8 @@ * - `BKE_lib_query_` should be used for functions in that file. */ +#include "BLI_sys_types.h" + #ifdef __cplusplus extern "C" { #endif @@ -208,6 +210,11 @@ int BKE_library_ID_use_ID(struct ID *id_user, struct ID *id_used); bool BKE_library_id_can_use_idtype(struct ID *id_owner, short id_type_used); /** + * Given the id_owner return the type of id_types it can use as a filter_id. + */ +uint64_t BKE_library_id_can_use_filter_id(const struct ID *id_owner); + +/** * Check whether given ID is used locally (i.e. by another non-linked ID). */ bool BKE_library_ID_is_locally_used(struct Main *bmain, void *idv); |