[Bf-blender-cvs] [cba1bdc4007] master: Fix T66641: Certain drivers fail to copy when copying a full scene.

Bastien Montagne noreply at git.blender.org
Tue Oct 1 14:51:16 CEST 2019


Commit: cba1bdc40071cbdb90122db121a643f761edeb36
Author: Bastien Montagne
Date:   Tue Oct 1 14:48:33 2019 +0200
Branches: master
https://developer.blender.org/rBcba1bdc40071cbdb90122db121a643f761edeb36

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.

===================================================================

M	source/blender/editors/object/object_relations.c

===================================================================

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. */



More information about the Bf-blender-cvs mailing list