Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenloader/intern/versioning_defaults.c
| Show All 40 Lines | |||||
| #include "DNA_light_types.h" | #include "DNA_light_types.h" | ||||
| #include "BKE_appdir.h" | #include "BKE_appdir.h" | ||||
| #include "BKE_brush.h" | #include "BKE_brush.h" | ||||
| #include "BKE_colortools.h" | #include "BKE_colortools.h" | ||||
| #include "BKE_layer.h" | #include "BKE_layer.h" | ||||
| #include "BKE_library.h" | #include "BKE_library.h" | ||||
| #include "BKE_main.h" | #include "BKE_main.h" | ||||
| #include "BKE_mesh.h" | |||||
| #include "BKE_node.h" | #include "BKE_node.h" | ||||
| #include "BKE_paint.h" | #include "BKE_paint.h" | ||||
| #include "BKE_screen.h" | #include "BKE_screen.h" | ||||
| #include "BKE_workspace.h" | #include "BKE_workspace.h" | ||||
| #include "BLO_readfile.h" | #include "BLO_readfile.h" | ||||
| /** | /** | ||||
| ▲ Show 20 Lines • Show All 280 Lines • ▼ Show 20 Lines | for (WorkSpace *workspace = bmain->workspaces.first; workspace; workspace = workspace->id.next) { | ||||
| /* For some reason we have unused screens, needed until re-saving. | /* For some reason we have unused screens, needed until re-saving. | ||||
| * Clear unused layouts because they're visible in the outliner & Python API. */ | * Clear unused layouts because they're visible in the outliner & Python API. */ | ||||
| LISTBASE_FOREACH_MUTABLE (WorkSpaceLayout *, layout_iter, &workspace->layouts) { | LISTBASE_FOREACH_MUTABLE (WorkSpaceLayout *, layout_iter, &workspace->layouts) { | ||||
| if (layout != layout_iter) { | if (layout != layout_iter) { | ||||
| BKE_workspace_layout_remove(bmain, workspace, layout_iter); | BKE_workspace_layout_remove(bmain, workspace, layout_iter); | ||||
| } | } | ||||
| } | } | ||||
| /* For Sculpting template. */ | |||||
| if (STREQ(workspace->id.name + 2, "Sculpting")) { | |||||
| for (Mesh *mesh = bmain->meshes.first; mesh; mesh = mesh->id.next) { | |||||
| mesh->remesh_voxel_size = 0.035f; | |||||
| mesh->flag |= ME_REMESH_FIX_POLES | ME_REMESH_REPROJECT_VOLUME; | |||||
| BKE_mesh_smooth_flag_set(mesh, false); | |||||
| } | |||||
brecht: This part editing meshes should not be inside the loop over workspaces. Meshes are not per… | |||||
| bScreen *screen = layout->screen; | |||||
| if (screen) { | |||||
| for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { | |||||
| for (ARegion *ar = sa->regionbase.first; ar; ar = ar->next) { | |||||
| if (sa->spacetype == SPACE_VIEW3D) { | |||||
| View3D *v3d = sa->spacedata.first; | |||||
| v3d->shading.flag &= ~V3D_SHADING_CAVITY; | |||||
| copy_v3_fl(v3d->shading.single_color, 1.0f); | |||||
| STRNCPY(v3d->shading.matcap, "basic_1"); | |||||
| } | |||||
| } | |||||
| } | |||||
brechtUnsubmitted Done Inline ActionsThis part editing the screen was meant to stay in BLO_update_defaults_workspace. brecht: This part editing the screen was meant to stay in `BLO_update_defaults_workspace`. | |||||
| } | |||||
| } | |||||
| } | } | ||||
| /* Scenes */ | /* Scenes */ | ||||
| for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { | for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { | ||||
| blo_update_defaults_scene(bmain, scene); | blo_update_defaults_scene(bmain, scene); | ||||
| if (app_template && STREQ(app_template, "Video_Editing")) { | if (app_template && STREQ(app_template, "Video_Editing")) { | ||||
| /* Filmic is too slow, use standard until it is optimized. */ | /* Filmic is too slow, use standard until it is optimized. */ | ||||
| ▲ Show 20 Lines • Show All 181 Lines • Show Last 20 Lines | |||||
This part editing meshes should not be inside the loop over workspaces. Meshes are not per-workspace so this makes no sense. They are part of an app template, which is why I suggested the app template test in my comment.