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:
Diffstat (limited to 'source/blender/blenloader/intern/versioning_280.c')
-rw-r--r--source/blender/blenloader/intern/versioning_280.c33
1 files changed, 31 insertions, 2 deletions
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index 523e0b3d340..e43553cd64f 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -591,17 +591,25 @@ static void do_versions_remove_region(ListBase *regionbase, int regiontype)
}
}
-static ARegion *do_versions_find_region(ListBase *regionbase, int regiontype)
+static ARegion *do_versions_find_region_or_null(ListBase *regionbase, int regiontype)
{
for (ARegion *ar = regionbase->first; ar; ar = ar->next) {
if (ar->regiontype == regiontype) {
return ar;
}
}
- BLI_assert(!"Did not find expected region in versioning");
return NULL;
}
+static ARegion *do_versions_find_region(ListBase *regionbase, int regiontype)
+{
+ ARegion *ar = do_versions_find_region_or_null(regionbase, regiontype);
+ if (ar == NULL) {
+ BLI_assert(!"Did not find expected region in versioning");
+ }
+ return ar;
+}
+
static ARegion *do_versions_add_region(int regiontype, const char *name)
{
ARegion *ar = MEM_callocN(sizeof(ARegion), name);
@@ -3130,6 +3138,27 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
}
+ /* Keep un-versioned until we're finished adding space types. */
+ {
+ for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
+ for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
+ for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
+ ListBase *regionbase = (sl == sa->spacedata.first) ? &sa->regionbase : &sl->regionbase;
+ /* All spaces that use tools must be eventually added. */
+ if (ELEM(sl->spacetype, SPACE_VIEW3D, SPACE_IMAGE) &&
+ (do_versions_find_region_or_null(regionbase, RGN_TYPE_TOOL_HEADER) == NULL)) {
+ /* Add tool header. */
+ ARegion *ar = do_versions_add_region(RGN_TYPE_TOOL_HEADER, "tool header");
+ ar->alignment = (U.uiflag & USER_HEADER_BOTTOM) ? RGN_ALIGN_BOTTOM : RGN_ALIGN_TOP;
+
+ ARegion *ar_header = do_versions_find_region(regionbase, RGN_TYPE_HEADER);
+ BLI_insertlinkbefore(regionbase, ar_header, ar);
+ }
+ }
+ }
+ }
+ }
+
{
if (!DNA_struct_elem_find(fd->filesdna, "bSplineIKConstraint", "short", "yScaleMode")) {
for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) {