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; | ||||
| 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); | 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); | |||||
| *transform_orientations = screen->scene->transform_spaces; | |||||
| } | } | ||||
| } | } | ||||
| /** | /** | ||||
| * \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 20 Lines • Show All 269 Lines • Show Last 20 Lines | |||||