[Bf-blender-cvs] [44ecea1ccbc] master: Fix T64304: Objects in appended scene from 2.79 file disappear after saving.

Bastien Montagne noreply at git.blender.org
Fri May 10 10:13:06 CEST 2019


Commit: 44ecea1ccbc06680cfc12a89799badbf0cc43ac9
Author: Bastien Montagne
Date:   Fri May 10 10:09:23 2019 +0200
Branches: master
https://developer.blender.org/rB44ecea1ccbc06680cfc12a89799badbf0cc43ac9

Fix T64304: Objects in appended scene from 2.79 file disappear after saving.

Versionning code generating collections from old 2.79 scene layers was
setting new collections' library from scene, but it also needs to
properly set the `LIB_TAG_INDIRECT` tag, otherwise localizing code does
not know what to do, and most of append process fails.

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

M	source/blender/blenkernel/intern/library.c
M	source/blender/blenloader/intern/versioning_280.c

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

diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index ad0c405ab28..3e6f93d1323 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -1860,7 +1860,7 @@ static void library_make_local_copying_check(ID *id,
  * (except group and objects ones).
  */
 /* Note: Old (2.77) version was simply making (tagging) data-blocks as local,
- * without actually making any check whether * they were also indirectly used or not...
+ * without actually making any check whether they were also indirectly used or not...
  *
  * Current version uses regular id_make_local callback, with advanced pre-processing step to detect
  * all cases of IDs currently indirectly used, but which will be used by local data only once this
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index f1c92dedd33..b958d7532bf 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -421,6 +421,9 @@ static void do_version_layers_to_collections(Main *bmain, Scene *scene)
 
           Collection *collection = BKE_collection_add(bmain, collection_master, name);
           collection->id.lib = scene->id.lib;
+          if (collection->id.lib != NULL) {
+            collection->id.tag |= LIB_TAG_INDIRECT;
+          }
           collections[layer] = collection;
 
           if (!(scene->lay & (1 << layer))) {



More information about the Bf-blender-cvs mailing list