diff options
Diffstat (limited to 'source/blender/blenloader/tests/blendfile_loading_base_test.cc')
-rw-r--r-- | source/blender/blenloader/tests/blendfile_loading_base_test.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/blenloader/tests/blendfile_loading_base_test.cc b/source/blender/blenloader/tests/blendfile_loading_base_test.cc index af570aa9d4b..615e30a728e 100644 --- a/source/blender/blenloader/tests/blendfile_loading_base_test.cc +++ b/source/blender/blenloader/tests/blendfile_loading_base_test.cc @@ -11,6 +11,7 @@ #include "BKE_global.h" #include "BKE_idtype.h" #include "BKE_image.h" +#include "BKE_layer.h" #include "BKE_main.h" #include "BKE_mball_tessellate.h" #include "BKE_modifier.h" @@ -116,7 +117,7 @@ bool BlendfileLoadingBaseTest::blendfile_load(const char *filepath) } char abspath[FILENAME_MAX]; - BLI_path_join(abspath, sizeof(abspath), test_assets_dir.c_str(), filepath, NULL); + BLI_path_join(abspath, sizeof(abspath), test_assets_dir.c_str(), filepath, nullptr); BlendFileReadReport bf_reports = {nullptr}; bfile = BLO_read_from_file(abspath, BLO_READ_SKIP_NONE, &bf_reports); @@ -125,6 +126,13 @@ bool BlendfileLoadingBaseTest::blendfile_load(const char *filepath) << test_assets_dir << "'"; return false; } + + /* Make sure that all view_layers in the file are synced. Depsgraph can make a copy of the whole + * scene, which will fail when one view layer isn't synced. */ + LISTBASE_FOREACH (ViewLayer *, view_layer, &bfile->curscene->view_layers) { + BKE_view_layer_synced_ensure(bfile->curscene, view_layer); + } + return true; } |