Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <bastien@blender.org>2020-06-17 18:01:21 +0300
committerBastien Montagne <bastien@blender.org>2020-06-17 18:06:05 +0300
commit13f591d400e2d17633bf7ebba9c7890fd563e4d2 (patch)
tree361374096efc8d2d2258bdec2946c352439680b2 /source/blender/blenkernel/BKE_lib_id.h
parentc84fee1ffeab3842d01779f1a2e5bfd826b48e60 (diff)
ID Duplicate: Factorize a lot the code.
Now that we have a uniform consistent behavior in all our ID duplicate funtions, we can easily factorize it greatly. Code gets cleaner, smaller, and less error-prone. Note that ultimately, this duplicate/deep copy behavior could be added as a callback of IDTypeInfo. We could also rethink the duplicate flags (some data, even some obdata, like Lattice, are not coverred currently). And so on. But at least code should now be much more easily maintainable and extendable.
Diffstat (limited to 'source/blender/blenkernel/BKE_lib_id.h')
-rw-r--r--source/blender/blenkernel/BKE_lib_id.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_lib_id.h b/source/blender/blenkernel/BKE_lib_id.h
index 8ee5562baae..e6a711732c9 100644
--- a/source/blender/blenkernel/BKE_lib_id.h
+++ b/source/blender/blenkernel/BKE_lib_id.h
@@ -227,6 +227,10 @@ bool id_single_user(struct bContext *C,
bool BKE_id_copy_is_allowed(const struct ID *id);
bool BKE_id_copy(struct Main *bmain, const struct ID *id, struct ID **newid);
bool BKE_id_copy_ex(struct Main *bmain, const struct ID *id, struct ID **r_newid, const int flag);
+struct ID *BKE_id_copy_for_duplicate(struct Main *bmain,
+ struct ID *id,
+ const bool is_owner_id_liboverride,
+ const uint duplicate_flags);
void BKE_lib_id_swap(struct Main *bmain, struct ID *id_a, struct ID *id_b);
void BKE_lib_id_swap_full(struct Main *bmain, struct ID *id_a, struct ID *id_b);