Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenloader/intern/versioning_defaults.c
| Show All 39 Lines | |||||
| #include "DNA_mesh_types.h" | #include "DNA_mesh_types.h" | ||||
| #include "DNA_material_types.h" | #include "DNA_material_types.h" | ||||
| #include "DNA_object_types.h" | #include "DNA_object_types.h" | ||||
| #include "DNA_workspace_types.h" | #include "DNA_workspace_types.h" | ||||
| #include "BKE_brush.h" | #include "BKE_brush.h" | ||||
| #include "BKE_library.h" | #include "BKE_library.h" | ||||
| #include "BKE_main.h" | #include "BKE_main.h" | ||||
| #include "BKE_scene.h" | |||||
| #include "BKE_workspace.h" | #include "BKE_workspace.h" | ||||
| #include "BLO_readfile.h" | #include "BLO_readfile.h" | ||||
| /** | /** | ||||
| * Override values in in-memory startup.blend, avoids resaving for small changes. | * Override values in in-memory startup.blend, avoids resaving for small changes. | ||||
| */ | */ | ||||
| ▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | static void update_defaults_startup_workspaces(Main *bmain) | ||||
| WorkSpace *workspace_default = NULL; | WorkSpace *workspace_default = NULL; | ||||
| for (WorkSpace *workspace = bmain->workspaces.first, *workspace_next; workspace; workspace = workspace_next) { | for (WorkSpace *workspace = bmain->workspaces.first, *workspace_next; workspace; workspace = workspace_next) { | ||||
| workspace_next = workspace->id.next; | workspace_next = workspace->id.next; | ||||
| if (STREQ(workspace->id.name + 2, "Default")) { | if (STREQ(workspace->id.name + 2, "Default")) { | ||||
| /* don't rename within iterator, renaming causes listbase to be re-sorted */ | /* don't rename within iterator, renaming causes listbase to be re-sorted */ | ||||
| workspace_default = workspace; | workspace_default = workspace; | ||||
| BKE_viewrender_init(&workspace->view_render); | |||||
| } | } | ||||
| else { | else { | ||||
| BKE_workspace_remove(bmain, workspace); | BKE_workspace_remove(bmain, workspace); | ||||
| } | } | ||||
| } | } | ||||
| /* rename "Default" workspace to "General" */ | /* rename "Default" workspace to "General" */ | ||||
| BKE_libblock_rename(bmain, (ID *)workspace_default, "General"); | BKE_libblock_rename(bmain, (ID *)workspace_default, "General"); | ||||
| BLI_assert(BLI_listbase_count(BKE_workspace_layouts_get(workspace_default)) == 1); | BLI_assert(BLI_listbase_count(BKE_workspace_layouts_get(workspace_default)) == 1); | ||||
| } | } | ||||
| /** | /** | ||||
| * Update defaults in startup.blend, without having to save and embed the file. | * Update defaults in startup.blend, without having to save and embed the file. | ||||
| * This function can be emptied each time the startup.blend is updated. */ | * This function can be emptied each time the startup.blend is updated. */ | ||||
| void BLO_update_defaults_startup_blend(Main *bmain) | void BLO_update_defaults_startup_blend(Main *bmain) | ||||
| { | { | ||||
| for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { | for (Scene *scene = bmain->scene.first; scene; scene = scene->id.next) { | ||||
| BLI_strncpy(scene->r.engine, RE_engine_id_BLENDER_EEVEE, sizeof(scene->r.engine)); | BLI_strncpy(scene->view_render.engine_id, RE_engine_id_BLENDER_EEVEE, sizeof(scene->view_render.engine_id)); | ||||
| /* XXX (dalai) not sure if the following is needed. */ | |||||
| /*scene->view_render = BKE_viewrender_new();*/ | |||||
| scene->r.im_format.planes = R_IMF_PLANES_RGBA; | scene->r.im_format.planes = R_IMF_PLANES_RGBA; | ||||
| scene->r.im_format.compress = 15; | scene->r.im_format.compress = 15; | ||||
| for (SceneRenderLayer *srl = scene->r.layers.first; srl; srl = srl->next) { | for (SceneRenderLayer *srl = scene->r.layers.first; srl; srl = srl->next) { | ||||
| srl->freestyleConfig.sphere_radius = 0.1f; | srl->freestyleConfig.sphere_radius = 0.1f; | ||||
| srl->pass_alpha_threshold = 0.5f; | srl->pass_alpha_threshold = 0.5f; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 209 Lines • Show Last 20 Lines | |||||