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 <montagne29@wanadoo.fr>2019-10-01 15:48:33 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2019-10-01 15:48:33 +0300
commitcba1bdc40071cbdb90122db121a643f761edeb36 (patch)
tree49ffc3e707dd341d4456a5f0a4b67abdbe8c0cb6
parentf983606063c68c5edb0921f999f1c4fe3f80a28e (diff)
Fix T66641: Certain drivers fail to copy when copying a full scene.
The core of the issue here is that 'make single user' functions still does its own, manual and quite partial, remapping of IDs, which covers all most common cases but cannot consider *all* possible ID usages (especially when it comes to drivers or custom properties, that can essentially point to any kind of data-blocks). This fix is merely a band-aid, there is no way to fully solve this without a complete rewrite of that area of code to make use of modern ID management code.
-rw-r--r--source/blender/editors/object/object_relations.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c
index 10ed26fcf59..d56791e5da0 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -2050,6 +2050,13 @@ void ED_object_single_users(Main *bmain,
single_obdata_users(bmain, scene, NULL, NULL, 0);
single_object_action_users(bmain, scene, NULL, NULL, 0);
single_mat_users_expand(bmain);
+ /* Duplicating obdata and other IDs may require another update of the collections and objects
+ * pointers, especially reguarding drivers and custom props, see T66641.
+ * Note that this whole scene duplication code and 'make single user' functions have te be
+ * rewritten at some point to make use of proper modern ID management code,
+ * but that is no small task.
+ * For now we are doomed to that kind of band-aid to try to cover most of remapping cases. */
+ libblock_relink_collection(scene->master_collection);
}
/* Relink nodetrees' pointers that have been duplicated. */