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-10 17:43:25 +0300
committerBastien Montagne <bastien@blender.org>2020-06-10 17:48:49 +0300
commit74ec37b70cbc8dc228f11d0796dbe68c24526b16 (patch)
tree5691206349ce3365d554ec64e136fc534908af76 /source/blender/blenkernel/intern/anim_data.c
parent1d0017089c6ad4bd9b87af1bb30024a86e7b2771 (diff)
Enable (deep) copy of overrides.
This commit enables basic copy of overrides on generic ID level, as well as from (deep) copy operators for objects and collections. So e.g. if your linked overridden caracter is in a collection, you can now (from the outliner) Duplicate that override collection to get a new overriding copy of the character. We still need operators (new or modifying existing ones) to handle that from 3DView e.g. Note that deep copy code for objects/collections (and incidently animdata) had to be modified to avoid duplicating/making local IDs that remain linked ones being used by overrides ones.
Diffstat (limited to 'source/blender/blenkernel/intern/anim_data.c')
-rw-r--r--source/blender/blenkernel/intern/anim_data.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/anim_data.c b/source/blender/blenkernel/intern/anim_data.c
index 9ab4e5c028d..cbb34cbee30 100644
--- a/source/blender/blenkernel/intern/anim_data.c
+++ b/source/blender/blenkernel/intern/anim_data.c
@@ -381,14 +381,15 @@ bool BKE_animdata_copy_id(Main *bmain, ID *id_to, ID *id_from, const int flag)
void BKE_animdata_copy_id_action(Main *bmain, ID *id, const bool set_newid)
{
+ const bool is_id_liboverride = ID_IS_OVERRIDE_LIBRARY(id);
AnimData *adt = BKE_animdata_from_id(id);
if (adt) {
- if (adt->action) {
+ if (adt->action && (!is_id_liboverride || !ID_IS_LINKED(adt->action))) {
id_us_min((ID *)adt->action);
adt->action = set_newid ? ID_NEW_SET(adt->action, BKE_action_copy(bmain, adt->action)) :
BKE_action_copy(bmain, adt->action);
}
- if (adt->tmpact) {
+ if (adt->tmpact && (!is_id_liboverride || !ID_IS_LINKED(adt->tmpact))) {
id_us_min((ID *)adt->tmpact);
adt->tmpact = set_newid ? ID_NEW_SET(adt->tmpact, BKE_action_copy(bmain, adt->tmpact)) :
BKE_action_copy(bmain, adt->tmpact);