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
path: root/source
diff options
context:
space:
mode:
authorBastien Montagne <bastien@blender.org>2021-01-15 19:44:35 +0300
committerBastien Montagne <bastien@blender.org>2021-01-15 21:00:38 +0300
commit5cf04fe2bae0f4031245794287f1b4903436cc07 (patch)
treee3e15ef0d322255aa339d1677dd57a53c7a0e4ef /source
parent3459f75f5b31e155bf549ec70dd2476dc810077e (diff)
Fix (unreported) copying liboverride of mesh breaks overrides of shape keys.
Our beloved shapekeys are 'virtual' overrides, they need special snowflake treatment here as well. They do not have any override data, from override perspective they are considered as mere sub-data from their owning ID (mesh, lattice, etc.). Therefore, we should not copy override data from them, but instead properly flag those new IDs as `LIB_EMBEDDED_DATA_LIB_OVERRIDE`. Found while investigating T84373.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/lib_id.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/lib_id.c b/source/blender/blenkernel/intern/lib_id.c
index 0cba26dd3d2..13f76b46570 100644
--- a/source/blender/blenkernel/intern/lib_id.c
+++ b/source/blender/blenkernel/intern/lib_id.c
@@ -1261,10 +1261,17 @@ void BKE_libblock_copy_ex(Main *bmain, const ID *id, ID **r_newid, const int ori
/* We may need our own flag to control that at some point, but for now 'no main' one should be
* good enough. */
- if ((orig_flag & LIB_ID_CREATE_NO_MAIN) == 0 && ID_IS_OVERRIDE_LIBRARY(id)) {
- /* We do not want to copy existing override rules here, as they would break the proper
- * remapping between IDs. Proper overrides rules will be re-generated anyway. */
- BKE_lib_override_library_copy(new_id, id, false);
+ if ((orig_flag & LIB_ID_CREATE_NO_MAIN) == 0) {
+ if (ID_IS_OVERRIDE_LIBRARY_REAL(id)) {
+ /* We do not want to copy existing override rules here, as they would break the proper
+ * remapping between IDs. Proper overrides rules will be re-generated anyway. */
+ BKE_lib_override_library_copy(new_id, id, false);
+ }
+ else if (ID_IS_OVERRIDE_LIBRARY_VIRTUAL(id)) {
+ /* Just ensure virtual overrides do get properly tagged, there is not actual override data to
+ * copy here. */
+ new_id->flag |= LIB_EMBEDDED_DATA_LIB_OVERRIDE;
+ }
}
if (id_can_have_animdata(new_id)) {