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.
This commit is contained in:
Dalai Felinto 2017-02-17 11:02:25 +01:00
parent 84141f27a6
commit 5a14578116
2 changed files with 7 additions and 1 deletions

View File

@ -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);

View File

@ -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);
}