[Bf-blender-cvs] [5a14578116] blender2.8: Layers: Fix crash on opening files saved in clay

Dalai Felinto noreply at git.blender.org
Fri Feb 17 11:02:29 CET 2017


Commit: 5a14578116488b23a22f49d0aee2eac3b036abbd
Author: Dalai Felinto
Date:   Fri Feb 17 11:02:25 2017 +0100
Branches: blender2.8
https://developer.blender.org/rB5a14578116488b23a22f49d0aee2eac3b036abbd

Layers: Fix crash on opening files saved in clay

Basically we were not tagging the layers and bases as dirty. As usual this will likely change once Depsgraph kicks in. But this will do for now.

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

M	source/blender/blenloader/intern/readfile.c
M	source/blender/blenloader/intern/versioning_280.c

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

diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 3413f30b9d..61a93018f7 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -126,6 +126,7 @@
 #include "BKE_fcurve.h"
 #include "BKE_global.h" // for G
 #include "BKE_group.h"
+#include "BKE_layer.h"
 #include "BKE_library.h" // for which_libbase
 #include "BKE_library_idmap.h"
 #include "BKE_library_query.h"
@@ -5809,9 +5810,12 @@ static void lib_link_scene(FileData *fd, Main *main)
 			lib_link_scene_collection(fd, sce->id.lib, sce->collection);
 
 			for (sl = sce->render_layers.first; sl; sl = sl->next) {
+				/* tag scene layer to update for collection tree evaluation */
+				sl->flag |= SCENE_LAYER_ENGINE_DIRTY;
 				for (Base *base = sl->object_bases.first; base; base = base->next) {
 					/* we only bump the use count for the collection objects */
 					base->object = newlibadr(fd, sce->id.lib, base->object);
+					base->flag |= BASE_DIRTY_ENGINE_SETTINGS;
 				}
 			}
 
@@ -6229,6 +6233,8 @@ static void direct_link_scene(FileData *fd, Scene *sce)
 		link_list(fd, &sl->object_bases);
 		sl->basact = newdataadr(fd, sl->basact);
 		direct_link_layer_collections(fd, &sl->layer_collections);
+		/* tag scene layer to update for collection tree evaluation */
+		BKE_scene_layer_base_flag_recalculate(sl);
 	}
 
 	link_list(fd, &sce->engines_settings);
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index b8867f7b62..4eb9741c3c 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -173,7 +173,7 @@ void do_versions_after_linking_280(Main *main)
 	}
 }
 
-void blo_do_version_temporary(Main *main)
+static void blo_do_version_temporary(Main *main)
 {
 	BKE_scene_layer_doversion_update(main);
 }




More information about the Bf-blender-cvs mailing list