Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Craddock <nzcraddock@gmail.com>2020-09-16 18:03:37 +0300
committerNathan Craddock <nzcraddock@gmail.com>2020-09-16 18:07:04 +0300
commit365271a5886e1678b41e636581616446766b5f85 (patch)
treeedb51854ff3123b29aca8d025bd7e99b4f56756b /source/blender
parent0696eaa3e84e9394518e9bc86217291aa58dcf13 (diff)
Fix tests after adding collection color tagging
Fix a segfault caused by assuming all scenes have a master collection when applying versioning to old files.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/intern/collection.c1
-rw-r--r--source/blender/blenloader/intern/versioning_290.c6
2 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c
index e8b29ffac3e..de2ec273567 100644
--- a/source/blender/blenkernel/intern/collection.c
+++ b/source/blender/blenkernel/intern/collection.c
@@ -650,6 +650,7 @@ Collection *BKE_collection_master_add()
STRNCPY(master_collection->id.name, "GRMaster Collection");
master_collection->id.flag |= LIB_EMBEDDED_DATA;
master_collection->flag |= COLLECTION_IS_MASTER;
+ master_collection->color_tag = COLLECTION_COLOR_NONE;
return master_collection;
}
diff --git a/source/blender/blenloader/intern/versioning_290.c b/source/blender/blenloader/intern/versioning_290.c
index 8a5f77fac1d..064b6139fde 100644
--- a/source/blender/blenloader/intern/versioning_290.c
+++ b/source/blender/blenloader/intern/versioning_290.c
@@ -658,7 +658,11 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
collection->color_tag = COLLECTION_COLOR_NONE;
}
LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
- scene->master_collection->color_tag = COLLECTION_COLOR_NONE;
+ /* Old files do not have a master collection, but it will be created by
+ * `BKE_collection_master_add()`. */
+ if (scene->master_collection) {
+ scene->master_collection->color_tag = COLLECTION_COLOR_NONE;
+ }
}
}