[Bf-blender-cvs] [fb0fc1d6133] blender-v2.82-release: Fix T73170: New Scene -> "Full Copy" Crashes Blender.

Bastien Montagne noreply at git.blender.org
Fri Jan 17 20:04:57 CET 2020


Commit: fb0fc1d613317eef50fbd395829476ce0b932bfc
Author: Bastien Montagne
Date:   Fri Jan 17 19:30:47 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rBfb0fc1d613317eef50fbd395829476ce0b932bfc

Fix T73170: New Scene -> "Full Copy" Crashes Blender.

rBac723db57fd8ba5 makes proper remapping of all pointers in Scene...
including the object pointers of bases in ViewLayers.

Using `BKE_main_collection_sync_remap()` makes sense here anyway
(compared to `BKE_main_collection_sync()`, it additionally clears caches
in ViewLayers and Collections), this whole code makes a lot of
remapping.

Note that I do not really understand *why* that was working OK
before rBac723db57fd8ba5. I.E. *why* not remapping at all ViewLayers'
base object pointers seemed to be OK...

This whole collection/viewlayer caching is very hard to follow, and
really needs a full rework at some point (just as much as ID copying
code in general, and scene copying code in particular, in fact).

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

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 6c5c523ba05..1fc139ec997 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -1802,7 +1802,7 @@ static void single_object_users(
 
   /* Making single user may affect other scenes if they share
    * with current one some collections in their ViewLayer. */
-  BKE_main_collection_sync(bmain);
+  BKE_main_collection_sync_remap(bmain);
 }
 
 /* not an especially efficient function, only added so the single user



More information about the Bf-blender-cvs mailing list