diff options
author | Joseph Eagar <joeedh@gmail.com> | 2022-04-04 18:58:52 +0300 |
---|---|---|
committer | Joseph Eagar <joeedh@gmail.com> | 2022-04-04 18:58:52 +0300 |
commit | 952821474044edb6658c636c5012d7949e7de0c7 (patch) | |
tree | 298346a7719109489916835e36420949633480aa /source/blender/blenloader | |
parent | d321d34a501c09234b123345badd8a7bdf2aba8a (diff) | |
parent | 9eb4cb956b7037e9737c2f15cde3d1bdcfff7d5f (diff) |
Merge remote-tracking branch 'origin/master' into temp-sculpt-colors
Diffstat (limited to 'source/blender/blenloader')
5 files changed, 79 insertions, 8 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 faa1b6bd9d7..7aa2c219835 100644 --- a/source/blender/blenloader/intern/versioning_300.c +++ b/source/blender/blenloader/intern/versioning_300.c @@ -56,6 +56,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" @@ -65,6 +66,7 @@ #include "MEM_guardedalloc.h" #include "readfile.h" +#include "SEQ_channels.h" #include "SEQ_iterator.h" #include "SEQ_sequencer.h" #include "SEQ_time.h" @@ -947,6 +949,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) { @@ -2490,7 +2500,59 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - if (!MAIN_VERSION_ATLEAST(bmain, 302, 8)) { + 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; + } + } + } + + if (!MAIN_VERSION_ATLEAST(bmain, 302, 9)) { /* While vertex-colors were experimental the smear tool became corrupt due * to bugs in the wm_toolsystem API (auto-creation of sculpt brushes * was broken). Go through and reset all smear brushes. */ 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. * |