diff options
Diffstat (limited to 'source/blender/blenloader')
5 files changed, 78 insertions, 7 deletions
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index b1c982649d2..0996b35c8ea 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -637,13 +637,6 @@ static ARegion *do_versions_find_region(ListBase *regionbase, int regiontype) return region; } -static ARegion *do_versions_add_region(int regiontype, const char *name) -{ - ARegion *region = MEM_callocN(sizeof(ARegion), name); - region->regiontype = regiontype; - return region; -} - static void do_versions_area_ensure_tool_region(Main *bmain, const short space_type, const short region_flag) diff --git a/source/blender/blenloader/intern/versioning_300.c b/source/blender/blenloader/intern/versioning_300.c index eee0e7fbea8..d2b8c4330bc 100644 --- a/source/blender/blenloader/intern/versioning_300.c +++ b/source/blender/blenloader/intern/versioning_300.c @@ -53,6 +53,7 @@ #include "BKE_main.h" #include "BKE_modifier.h" #include "BKE_node.h" +#include "BKE_screen.h" #include "RNA_access.h" #include "RNA_enum_types.h" @@ -62,6 +63,7 @@ #include "MEM_guardedalloc.h" #include "readfile.h" +#include "SEQ_channels.h" #include "SEQ_iterator.h" #include "SEQ_sequencer.h" #include "SEQ_time.h" @@ -944,6 +946,14 @@ static bool seq_transform_filter_set(Sequence *seq, void *UNUSED(user_data)) return true; } +static bool seq_meta_channels_ensure(Sequence *seq, void *UNUSED(user_data)) +{ + if (seq->type == SEQ_TYPE_META) { + SEQ_channels_ensure(&seq->channels); + } + return true; +} + static void do_version_subsurface_methods(bNode *node) { if (node->type == SH_NODE_SUBSURFACE_SCATTERING) { @@ -2487,6 +2497,58 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain) } } + if (!MAIN_VERSION_ATLEAST(bmain, 302, 9)) { + /* Sequencer channels region. */ + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { + LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) { + LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) { + if (sl->spacetype != SPACE_SEQ) { + continue; + } + if (ELEM(((SpaceSeq *)sl)->view, SEQ_VIEW_PREVIEW, SEQ_VIEW_SEQUENCE_PREVIEW)) { + continue; + } + + ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase : + &sl->regionbase; + ARegion *region = BKE_area_find_region_type(area, RGN_TYPE_CHANNELS); + if (!region) { + ARegion *tools_region = BKE_area_find_region_type(area, RGN_TYPE_TOOLS); + region = do_versions_add_region(RGN_TYPE_CHANNELS, "channels region"); + BLI_insertlinkafter(regionbase, tools_region, region); + region->alignment = RGN_ALIGN_LEFT; + region->v2d.flag |= V2D_VIEWSYNC_AREA_VERTICAL; + } + + ARegion *timeline_region = BKE_area_find_region_type(area, RGN_TYPE_WINDOW); + if (timeline_region != NULL) { + timeline_region->v2d.flag |= V2D_VIEWSYNC_AREA_VERTICAL; + } + } + } + } + + /* Initialize channels. */ + LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) { + Editing *ed = SEQ_editing_get(scene); + if (ed == NULL) { + continue; + } + SEQ_channels_ensure(&ed->channels); + SEQ_for_each_callback(&scene->ed->seqbase, seq_meta_channels_ensure, NULL); + + ed->displayed_channels = &ed->channels; + + ListBase *previous_channels = &ed->channels; + LISTBASE_FOREACH (MetaStack *, ms, &ed->metastack) { + ms->old_channels = previous_channels; + previous_channels = &ms->parseq->channels; + /* If `MetaStack` exists, active channels must point to last link. */ + ed->displayed_channels = &ms->parseq->channels; + } + } + } + /** * Versioning code until next subversion bump goes here. * diff --git a/source/blender/blenloader/intern/versioning_common.cc b/source/blender/blenloader/intern/versioning_common.cc index 281769410bd..d2a55f6f37e 100644 --- a/source/blender/blenloader/intern/versioning_common.cc +++ b/source/blender/blenloader/intern/versioning_common.cc @@ -225,3 +225,10 @@ void version_socket_update_is_used(bNodeTree *ntree) link->tosock->flag |= SOCK_IN_USE; } } + +ARegion *do_versions_add_region(int regiontype, const char *name) +{ + ARegion *region = (ARegion *)MEM_callocN(sizeof(ARegion), name); + region->regiontype = regiontype; + return region; +} diff --git a/source/blender/blenloader/intern/versioning_common.h b/source/blender/blenloader/intern/versioning_common.h index 939b87823d4..c8c7dcc7cff 100644 --- a/source/blender/blenloader/intern/versioning_common.h +++ b/source/blender/blenloader/intern/versioning_common.h @@ -88,6 +88,7 @@ struct bNodeSocket *version_node_add_socket_if_not_exist(struct bNodeTree *ntree * the flag on all sockets after changes to the node tree. */ void version_socket_update_is_used(bNodeTree *ntree); +ARegion *do_versions_add_region(int regiontype, const char *name); #ifdef __cplusplus } diff --git a/source/blender/blenloader/intern/versioning_userdef.c b/source/blender/blenloader/intern/versioning_userdef.c index ec76f516780..dcf2ce4438d 100644 --- a/source/blender/blenloader/intern/versioning_userdef.c +++ b/source/blender/blenloader/intern/versioning_userdef.c @@ -328,6 +328,14 @@ static void do_versions_theme(const UserDef *userdef, bTheme *btheme) if (!USER_VERSION_ATLEAST(302, 8)) { btheme->space_node.grid_levels = U_theme_default.space_node.grid_levels; } + + if (!USER_VERSION_ATLEAST(302, 9)) { + FROM_DEFAULT_V4_UCHAR(space_sequencer.list); + FROM_DEFAULT_V4_UCHAR(space_sequencer.list_title); + FROM_DEFAULT_V4_UCHAR(space_sequencer.list_text); + FROM_DEFAULT_V4_UCHAR(space_sequencer.list_text_hi); + } + /** * Versioning code until next subversion bump goes here. * |