Workspace: Move engines to workspace and Properties Editor cleanup
[blender.git] / source / blender / blenloader / intern / versioning_280.c
index ba46c8f81b80112992783e242a1a86a973817efa..55245cec56c2e43a526dce67b394e6bd6aa659d4 100644 (file)
@@ -192,7 +192,6 @@ void do_versions_after_linking_280(Main *main)
                                        for (SceneRenderLayer *srl = scene->r.layers.first; srl; srl = srl->next) {
 
                                                SceneLayer *sl = BKE_scene_layer_add(scene, srl->name);
-                                               BKE_scene_layer_engine_set(sl, scene->r.engine);
 
                                                if (srl->mat_override) {
                                                        BKE_collection_override_datablock_add((LayerCollection *)sl->layer_collections.first, "material", (ID *)srl->mat_override);
@@ -510,4 +509,17 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *main)
                        printf("You need to combine transparency and emission shaders to the converted Principled shader nodes.\n");
                }
        }
+
+       {
+               if (!DNA_struct_elem_find(fd->filesdna, "Scene", "ViewRender", "view_render")) {
+                       for (Scene *scene = main->scene.first; scene; scene = scene->id.next) {
+                               BLI_strncpy_utf8(scene->view_render.engine_id, scene->r.engine,
+                                                sizeof(scene->view_render.engine_id));
+                       }
+
+                       for (WorkSpace *workspace = main->workspaces.first; workspace; workspace = workspace->id.next) {
+                               BKE_viewrender_init(&workspace->view_render);
+                       }
+               }
+       }
 }