diff options
author | Bastien Montagne <bastien@blender.org> | 2022-09-08 14:06:40 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2022-09-08 17:34:31 +0300 |
commit | 462014b59b4f5ad110ebfcbc17dfa1f896582110 (patch) | |
tree | b3b809c4f718a441650b03dd8a5c1adffa20f9cd /source/blender/blenkernel/BKE_lib_id.h | |
parent | 4ac69c26db4c246dfb597411884af2a7ecc7ee66 (diff) |
IDManagement: Add new `BKE_id_owner_get` accessor.
Essentially calls `IDTypeInfo->owner_get` for now, will make more sense
once the callback is changed to return the address of the pointer
instead.
Diffstat (limited to 'source/blender/blenkernel/BKE_lib_id.h')
-rw-r--r-- | source/blender/blenkernel/BKE_lib_id.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_lib_id.h b/source/blender/blenkernel/BKE_lib_id.h index febdad2ca0d..4e4b393fcd6 100644 --- a/source/blender/blenkernel/BKE_lib_id.h +++ b/source/blender/blenkernel/BKE_lib_id.h @@ -620,6 +620,13 @@ bool BKE_id_is_in_global_main(struct ID *id); bool BKE_id_can_be_asset(const struct ID *id); +/** + * Return the owner ID of the given `id`, if any. + * + * \note: This will only return non-NULL for embedded IDs (master collections etc.), and shapekeys. + */ +struct ID *BKE_id_owner_get(struct ID *id); + /** Check if that ID can be considered as editable from a high-level (editor) perspective. * * NOTE: This used to be done with a check on whether ID was linked or not, but now with system |