Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenloader/intern/versioning_280.c
| Show First 20 Lines • Show All 146 Lines • ▼ Show 20 Lines | if (workspace == NULL) { | ||||
| continue; /* Not much we can do. */ | continue; /* Not much we can do. */ | ||||
| } | } | ||||
| BKE_workspace_layout_add(bmain, workspace, screen, screen->id.name + 2); | BKE_workspace_layout_add(bmain, workspace, screen, screen->id.name + 2); | ||||
| } | } | ||||
| bmain->is_locked_for_linking = true; | bmain->is_locked_for_linking = true; | ||||
| } | } | ||||
| static void do_version_area_change_space_to_space_action(ScrArea *area, const Scene *scene) | static void do_version_area_change_space_to_space_action(const wmWindow *win, ScrArea *area) | ||||
| { | { | ||||
| SpaceType *stype = BKE_spacetype_from_id(SPACE_ACTION); | SpaceType *stype = BKE_spacetype_from_id(SPACE_ACTION); | ||||
| SpaceAction *saction = (SpaceAction *)stype->create(area, scene); | SpaceAction *saction = (SpaceAction *)stype->create(win, area); | ||||
| ARegion *region_channels; | ARegion *region_channels; | ||||
| /* Properly free current regions */ | /* Properly free current regions */ | ||||
| LISTBASE_FOREACH (ARegion *, region, &area->regionbase) { | LISTBASE_FOREACH (ARegion *, region, &area->regionbase) { | ||||
| BKE_area_region_free(area->type, region); | BKE_area_region_free(area->type, region); | ||||
| } | } | ||||
| BLI_freelistN(&area->regionbase); | BLI_freelistN(&area->regionbase); | ||||
| ▲ Show 20 Lines • Show All 1,185 Lines • ▼ Show 20 Lines | if (!MAIN_VERSION_ATLEAST(bmain, 280, 4)) { | ||||
| for (ParticleSettings *part = bmain->particles.first; part; part = part->id.next) { | for (ParticleSettings *part = bmain->particles.first; part; part = part->id.next) { | ||||
| part->draw &= ~PART_DRAW_EMITTER; | part->draw &= ~PART_DRAW_EMITTER; | ||||
| } | } | ||||
| } | } | ||||
| /* SpaceTime & SpaceLogic removal/replacing */ | /* SpaceTime & SpaceLogic removal/replacing */ | ||||
| if (!MAIN_VERSION_ATLEAST(bmain, 280, 9)) { | if (!MAIN_VERSION_ATLEAST(bmain, 280, 9)) { | ||||
| const wmWindowManager *wm = bmain->wm.first; | const wmWindowManager *wm = bmain->wm.first; | ||||
| const Scene *scene = bmain->scenes.first; | |||||
| if (wm != NULL) { | if (wm != NULL) { | ||||
| /* Action editors need a scene for creation. First, update active | |||||
| * screens using the active scene of the window they're displayed in. | |||||
| * Next, update remaining screens using first scene in main listbase. */ | |||||
| LISTBASE_FOREACH (wmWindow *, win, &wm->windows) { | LISTBASE_FOREACH (wmWindow *, win, &wm->windows) { | ||||
| const bScreen *screen = BKE_workspace_active_screen_get(win->workspace_hook); | const bScreen *screen = BKE_workspace_active_screen_get(win->workspace_hook); | ||||
| LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) { | LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) { | ||||
| if (ELEM(area->butspacetype, SPACE_TIME, SPACE_LOGIC)) { | if (ELEM(area->butspacetype, SPACE_TIME, SPACE_LOGIC)) { | ||||
| do_version_area_change_space_to_space_action(area, win->scene); | do_version_area_change_space_to_space_action(win, area); | ||||
| /* Don't forget to unset! */ | /* Don't forget to unset! */ | ||||
| area->butspacetype = SPACE_EMPTY; | area->butspacetype = SPACE_EMPTY; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | |||||
| if (scene != NULL) { | const wmWindow *win = wm->windows.first; | ||||
| if (win != NULL) { | |||||
| for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { | for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { | ||||
| LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) { | LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) { | ||||
| if (ELEM(area->butspacetype, SPACE_TIME, SPACE_LOGIC)) { | if (ELEM(area->butspacetype, SPACE_TIME, SPACE_LOGIC)) { | ||||
| /* Areas that were already handled won't be handled again */ | /* Areas that were already handled won't be handled again */ | ||||
| do_version_area_change_space_to_space_action(area, scene); | do_version_area_change_space_to_space_action(win, area); | ||||
| /* Don't forget to unset! */ | /* Don't forget to unset! */ | ||||
| area->butspacetype = SPACE_EMPTY; | area->butspacetype = SPACE_EMPTY; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | |||||
| #ifdef USE_COLLECTION_COMPAT_28 | #ifdef USE_COLLECTION_COMPAT_28 | ||||
| if (use_collection_compat_28 && !MAIN_VERSION_ATLEAST(bmain, 280, 14)) { | if (use_collection_compat_28 && !MAIN_VERSION_ATLEAST(bmain, 280, 14)) { | ||||
| for (Collection *group = bmain->collections.first; group; group = group->id.next) { | for (Collection *group = bmain->collections.first; group; group = group->id.next) { | ||||
| do_version_group_collection_to_collection(bmain, group); | do_version_group_collection_to_collection(bmain, group); | ||||
| } | } | ||||
| for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { | for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { | ||||
| ▲ Show 20 Lines • Show All 3,692 Lines • Show Last 20 Lines | |||||