Cleanup: code style
[blender.git] / source / blender / blenloader / intern / versioning_280.c
index 83a0f21002a788883a0940075c4b53fcbe64e5e6..e7d4e4f33aea0e48932a15b3ff06f79061842d12 100644 (file)
@@ -60,6 +60,7 @@
 #include "BKE_customdata.h"
 #include "BKE_freestyle.h"
 #include "BKE_idprop.h"
 #include "BKE_customdata.h"
 #include "BKE_freestyle.h"
 #include "BKE_idprop.h"
+#include "BKE_image.h"
 #include "BKE_layer.h"
 #include "BKE_main.h"
 #include "BKE_mesh.h"
 #include "BKE_layer.h"
 #include "BKE_main.h"
 #include "BKE_mesh.h"
@@ -113,7 +114,7 @@ static void do_version_workspaces_create_from_screens(Main *bmain)
                else {
                        workspace = BKE_workspace_add(bmain, screen->id.name + 2);
                }
                else {
                        workspace = BKE_workspace_add(bmain, screen->id.name + 2);
                }
-               BKE_workspace_layout_add(workspace, screen, screen->id.name + 2);
+               BKE_workspace_layout_add(bmain, workspace, screen, screen->id.name + 2);
                BKE_workspace_view_layer_set(workspace, layer, scene);
        }
 }
                BKE_workspace_view_layer_set(workspace, layer, scene);
        }
 }
@@ -1444,15 +1445,8 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
 
                if (!MAIN_VERSION_ATLEAST(bmain, 280, 15)) {
                        for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
 
                if (!MAIN_VERSION_ATLEAST(bmain, 280, 15)) {
                        for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) {
-                               scene->display.matcap_icon = 1;
-                               scene->display.matcap_type = CLAY_MATCAP_NONE;
-                               scene->display.matcap_hue = 0.5f;
-                               scene->display.matcap_saturation = 0.5f;
-                               scene->display.matcap_value = 0.5f;
                                scene->display.matcap_ssao_distance = 0.2f;
                                scene->display.matcap_ssao_attenuation = 1.0f;
                                scene->display.matcap_ssao_distance = 0.2f;
                                scene->display.matcap_ssao_attenuation = 1.0f;
-                               scene->display.matcap_ssao_factor_cavity = 1.0f;
-                               scene->display.matcap_ssao_factor_edge = 1.0f;
                                scene->display.matcap_ssao_samples = 16;
                        }
 
                                scene->display.matcap_ssao_samples = 16;
                        }
 
@@ -1581,5 +1575,28 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
                                }
                        }
                }
                                }
                        }
                }
+               if (!DNA_struct_elem_find(fd->filesdna, "View3DOverlay", "float", "bone_selection_alpha")) {
+                       for (bScreen *screen = bmain->screen.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) {
+                                               if (sl->spacetype == SPACE_VIEW3D) {
+                                                       View3D *v3d = (View3D *)sl;
+                                                       v3d->overlay.bone_selection_alpha = 0.5f;
+                                               }
+                                       }
+                               }
+                       }
+               }
+               if (!DNA_struct_elem_find(fd->filesdna, "Image", "ListBase", "renderslot")) {
+                       for (Image *ima = bmain->image.first; ima; ima = ima->id.next) {
+                               if (ima->type == IMA_TYPE_R_RESULT) {
+                                       for (int i = 0; i < 8; i++) {
+                                               RenderSlot *slot = MEM_callocN(sizeof(RenderSlot), "Image Render Slot Init");
+                                               BLI_snprintf(slot->name, sizeof(slot->name), "Slot %d", i + 1);
+                                               BLI_addtail(&ima->renderslots, slot);
+                                       }
+                               }
+                       }
+               }
        }
 }
        }
 }