diff options
author | Bastien Montagne <bastien@blender.org> | 2022-08-03 11:48:43 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2022-08-03 11:49:20 +0300 |
commit | 25517f36bcca5ddb24970c0513d85f88f90aa284 (patch) | |
tree | 4317da3fde5af53eb8664c6d0301b2f9ab62fc71 /source/blender/blenkernel/BKE_lib_id.h | |
parent | 89f0fedb5cfcde8d2d29f4cf08f3cfa194c375b2 (diff) |
Cleanup: Improve doc of the `BKE_id_copy` functions.
Diffstat (limited to 'source/blender/blenkernel/BKE_lib_id.h')
-rw-r--r-- | source/blender/blenkernel/BKE_lib_id.h | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/source/blender/blenkernel/BKE_lib_id.h b/source/blender/blenkernel/BKE_lib_id.h index f4265dfd004..94497d9a487 100644 --- a/source/blender/blenkernel/BKE_lib_id.h +++ b/source/blender/blenkernel/BKE_lib_id.h @@ -400,13 +400,10 @@ bool id_single_user(struct bContext *C, struct ID *id, struct PointerRNA *ptr, struct PropertyRNA *prop); + +/** Test whether given `id` can be copied or not. */ bool BKE_id_copy_is_allowed(const struct ID *id); /** - * Invokes the appropriate copy method for the block and returns the result in - * #ID.newid, unless test. Returns true if the block can be copied. - */ -struct ID *BKE_id_copy(struct Main *bmain, const struct ID *id); -/** * Generic entry point for copying a data-block (new API). * * \note Copy is generally only affecting the given data-block @@ -430,8 +427,26 @@ struct ID *BKE_id_copy(struct Main *bmain, const struct ID *id); */ struct ID *BKE_id_copy_ex(struct Main *bmain, const struct ID *id, struct ID **r_newid, int flag); /** - * Invokes the appropriate copy method for the block and returns the result in - * newid, unless test. Returns true if the block can be copied. + * Invoke the appropriate copy method for the block and return the new id as result. + * + * See #BKE_id_copy_ex for details. + */ +struct ID *BKE_id_copy(struct Main *bmain, const struct ID *id); + +/** + * Invoke the appropriate copy method for the block and return the new id as result. + * + * Unlike #BKE_id_copy, it does set the #ID.newid pointer of the given `id` to the copied one. + * + * It is designed as a basic common helper for the higher-level 'duplicate' operations (aka 'deep + * copy' of data-blocks and some of their dependency ones), see e.g. #BKE_object_duplicate. + * + * Currently, it only handles the given ID, and their shape keys and actions if any, according to + * the given `duplicate_flags`. + * + * \param duplicate_flags is of type #eDupli_ID_Flags, see #UserDef.dupflag. Currently only + * `USER_DUP_LINKED_ID` and `USER_DUP_ACT` have an effect here. + * \param copy_flags flags passed to #BKE_id_copy_ex. */ struct ID *BKE_id_copy_for_duplicate(struct Main *bmain, struct ID *id, |