diff options
author | Bastien Montagne <bastien@blender.org> | 2021-11-19 13:48:25 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2021-11-19 14:09:28 +0300 |
commit | 83e245023c481aa2f57588724915e554c00c05d2 (patch) | |
tree | 2c26c51aebd12ffb4e99f853e492114be2b81e9b /source/blender/blenkernel/intern | |
parent | de3fda29c79f143d0bc251ded5bcbf4613417247 (diff) |
Fix (unreported) wrong behavior of constraints in liboverrides.
All constraints were 'made local', including the ones comming from the
reference linked object.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/constraint.c | 5 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/lib_override.c | 5 |
2 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index b2b03d28483..7ddbaa0e9ee 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -6022,7 +6022,6 @@ bConstraint *BKE_constraint_duplicate_ex(bConstraint *src, const int flag, const bConstraint *dst = MEM_dupallocN(src); constraint_copy_data_ex(dst, src, flag, do_extern); dst->next = dst->prev = NULL; - dst->flag |= CONSTRAINT_OVERRIDE_LIBRARY_LOCAL; return dst; } @@ -6057,7 +6056,9 @@ void BKE_constraints_copy_ex(ListBase *dst, const ListBase *src, const int flag, for (con = dst->first, srccon = src->first; con && srccon; srccon = srccon->next, con = con->next) { constraint_copy_data_ex(con, srccon, flag, do_extern); - con->flag |= CONSTRAINT_OVERRIDE_LIBRARY_LOCAL; + if ((flag & LIB_ID_COPY_NO_LIB_OVERRIDE_LOCAL_DATA_FLAG) == 0) { + con->flag |= CONSTRAINT_OVERRIDE_LIBRARY_LOCAL; + } } } diff --git a/source/blender/blenkernel/intern/lib_override.c b/source/blender/blenkernel/intern/lib_override.c index 5117c8bd64c..9ed7218027f 100644 --- a/source/blender/blenkernel/intern/lib_override.c +++ b/source/blender/blenkernel/intern/lib_override.c @@ -2874,7 +2874,10 @@ void BKE_lib_override_library_update(Main *bmain, ID *local) * Not impossible to do, but would rather see first if extra useless usual user handling * is actually a (performances) issue here. */ - ID *tmp_id = BKE_id_copy(bmain, local->override_library->reference); + ID *tmp_id = BKE_id_copy_ex(bmain, + local->override_library->reference, + NULL, + LIB_ID_COPY_DEFAULT | LIB_ID_COPY_NO_LIB_OVERRIDE_LOCAL_DATA_FLAG); if (tmp_id == NULL) { return; |