Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenloader/intern/versioning_280.c
| Show First 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | static bScreen *screen_parent_find(const bScreen *screen) | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| static void do_version_workspaces_create_from_screens(Main *bmain) | static void do_version_workspaces_create_from_screens(Main *bmain) | ||||
| { | { | ||||
| for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { | for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { | ||||
| const bScreen *screen_parent = screen_parent_find(screen); | const bScreen *screen_parent = screen_parent_find(screen); | ||||
| WorkSpace *workspace; | WorkSpace *workspace; | ||||
| WorkSpaceLayout *layout; | |||||
| ListBase *transform_orientations; | |||||
| if (screen_parent) { | if (screen_parent) { | ||||
| /* fullscreen with "Back to Previous" option, don't create | /* fullscreen with "Back to Previous" option, don't create | ||||
| * a new workspace, add layout workspace containing parent */ | * a new workspace, add layout workspace containing parent */ | ||||
| workspace = BLI_findstring( | workspace = BLI_findstring( | ||||
| &bmain->workspaces, screen_parent->id.name + 2, offsetof(ID, name) + 2); | &bmain->workspaces, screen_parent->id.name + 2, offsetof(ID, name) + 2); | ||||
| } | } | ||||
| else { | else { | ||||
| workspace = BKE_workspace_add(bmain, screen->id.name + 2); | workspace = BKE_workspace_add(bmain, screen->id.name + 2); | ||||
| } | } | ||||
| BKE_workspace_layout_add(workspace, screen, screen->id.name + 2); | layout = BKE_workspace_layout_add(workspace, screen, screen->id.name + 2); | ||||
| BKE_workspace_render_layer_set(workspace, screen->scene->render_layers.first); | BKE_workspace_render_layer_set(workspace, screen->scene->render_layers.first); | ||||
| transform_orientations = BKE_workspace_transform_orientations_get(workspace); | |||||
| BLI_duplicatelist(transform_orientations, &screen->scene->transform_spaces); | |||||
| BKE_workspace_transform_orientations_sanitize(workspace, layout); | |||||
| } | } | ||||
| } | } | ||||
| /** | /** | ||||
| * \brief After lib-link versioning for new workspace design. | * \brief After lib-link versioning for new workspace design. | ||||
| * | * | ||||
| * * Adds a workspace for (almost) each screen of the old file | * * Adds a workspace for (almost) each screen of the old file | ||||
| * and adds the needed workspace-layout to wrap the screen. | * and adds the needed workspace-layout to wrap the screen. | ||||
| Show All 24 Lines | for (wmWindow *win = wm->windows.first; win; win = win->next) { | ||||
| win->scene = screen->scene; | win->scene = screen->scene; | ||||
| /* Deprecated from now on! */ | /* Deprecated from now on! */ | ||||
| win->screen = NULL; | win->screen = NULL; | ||||
| } | } | ||||
| } | } | ||||
| for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { | for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { | ||||
| /* Deprecated from now on! */ | /* Deprecated from now on! */ | ||||
| BLI_freelistN(&screen->scene->transform_spaces); | |||||
| screen->scene = NULL; | screen->scene = NULL; | ||||
| } | } | ||||
| } | } | ||||
| void do_versions_after_linking_280(Main *main) | void do_versions_after_linking_280(Main *main) | ||||
| { | { | ||||
| if (!MAIN_VERSION_ATLEAST(main, 280, 0)) { | if (!MAIN_VERSION_ATLEAST(main, 280, 0)) { | ||||
| char version[48]; | char version[48]; | ||||
| ▲ Show 20 Lines • Show All 229 Lines • Show Last 20 Lines | |||||