Merge branch 'blender2.8' into userpref_redesign
[blender.git] / source / blender / blenloader / intern / versioning_280.c
index a28b4ae77844ddde12dbe7d9ccee15d27aa08c31..a24f9bd879055fa910a4de7834b0d7eeca6df96f 100644 (file)
@@ -1207,44 +1207,6 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
                                probe->intensity = 1.0f;
                        }
                }
-
-               for (Object *ob = bmain->object.first; ob; ob = ob->id.next) {
-                       bConstraint *con, *con_next;
-                       con = ob->constraints.first;
-                       while (con) {
-                               con_next = con->next;
-                               if (con->type == 17) { /* CONSTRAINT_TYPE_RIGIDBODYJOINT */
-                                       BLI_remlink(&ob->constraints, con);
-                                       BKE_constraint_free_data(con);
-                                       MEM_freeN(con);
-                               }
-                               con = con_next;
-                       }
-               }
-
-               if (!DNA_struct_elem_find(fd->filesdna, "Scene", "int", "orientation_index_custom")) {
-                       for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
-                               scene->orientation_index_custom = -1;
-                       }
-               }
-
-               for (bScreen *sc = bmain->screen.first; sc; sc = sc->id.next) {
-                       for (ScrArea *sa = sc->areabase.first; sa; sa = sa->next) {
-                               for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
-                                       if (sl->spacetype == SPACE_VIEW3D) {
-                                               View3D *v3d = (View3D *)sl;
-                                               v3d->shading.light = V3D_LIGHTING_STUDIO;
-                                               v3d->shading.flag |= V3D_SHADING_OBJECT_OUTLINE;
-
-                                               /* Assume (demo) files written with 2.8 want to show
-                                                * Eevee renders in the viewport. */
-                                               if (MAIN_VERSION_ATLEAST(bmain, 280, 0)) {
-                                                       v3d->drawtype = OB_MATERIAL;
-                                               }
-                                       }
-                               }
-                       }
-               }
        }
 
        if (!MAIN_VERSION_ATLEAST(bmain, 280, 7)) {
@@ -2428,4 +2390,26 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
                }
        }
 
+       {
+               for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) {
+                       for (ScrArea *area = screen->areabase.first; area; area = area->next) {
+                               for (SpaceLink *slink = area->spacedata.first; slink; slink = slink->next) {
+                                       if (slink->spacetype == SPACE_USERPREF) {
+                                               ARegion *navigation_region = BKE_spacedata_find_region_type(slink, area, RGN_TYPE_UI);
+
+                                               if (!navigation_region) {
+                                                       ListBase *regionbase = (slink == area->spacedata.first) ?
+                                                                                  &area->regionbase : &slink->regionbase;
+
+                                                       navigation_region = MEM_callocN(sizeof(ARegion), "userpref navigation-region do_versions");
+
+                                                       BLI_addhead(regionbase, navigation_region); /* order matters, addhead not addtail! */
+                                                       navigation_region->regiontype = RGN_TYPE_UI;
+                                                       navigation_region->alignment = RGN_ALIGN_LEFT;
+                                               }
+                                       }
+                               }
+                       }
+               }
+       }
 }