Fix T101622: Sequencer channels not updating while panning view

`V2D_VIEWSYNC_AREA_VERTICAL` flag was mistakenly set to the sequencer
toolbar region instead of the channels region.

Reviewed By: ISS

Differential Revision: https://developer.blender.org/D16155
This commit is contained in:
Yann Lanthony 2022-10-19 19:49:15 +02:00 committed by Richard Antalik
parent c14b113746
commit c3d0ba3b33
Notes: blender-bot 2023-02-14 06:49:57 +01:00
Referenced by issue #101622, Sequencer channels not updating while panning/scaling the view
3 changed files with 25 additions and 2 deletions

View File

@ -25,7 +25,7 @@ extern "C" {
/* Blender file format version. */
#define BLENDER_FILE_VERSION BLENDER_VERSION
#define BLENDER_FILE_SUBVERSION 4
#define BLENDER_FILE_SUBVERSION 5
/* Minimum Blender version that supports reading file written with the current
* version. Older Blender versions will test this and show a warning if the file

View File

@ -3630,6 +3630,29 @@ void blo_do_versions_300(FileData *fd, Library * /*lib*/, Main *bmain)
}
}
if (!MAIN_VERSION_ATLEAST(bmain, 304, 5)) {
/* Fix for T101622 - update flags of sequence editor regions that were not initialized
* properly. */
LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase :
&sl->regionbase;
if (sl->spacetype == SPACE_SEQ) {
LISTBASE_FOREACH (ARegion *, region, regionbase) {
if (region->regiontype == RGN_TYPE_TOOLS) {
region->v2d.flag &= ~V2D_VIEWSYNC_AREA_VERTICAL;
}
if (region->regiontype == RGN_TYPE_CHANNELS) {
region->v2d.flag |= V2D_VIEWSYNC_AREA_VERTICAL;
}
}
}
}
}
}
}
/**
* Versioning code until next subversion bump goes here.
*

View File

@ -129,7 +129,6 @@ static SpaceLink *sequencer_create(const ScrArea *UNUSED(area), const Scene *sce
region->regiontype = RGN_TYPE_TOOLS;
region->alignment = RGN_ALIGN_LEFT;
region->flag = RGN_FLAG_HIDDEN;
region->v2d.flag |= V2D_VIEWSYNC_AREA_VERTICAL;
/* Channels. */
region = MEM_callocN(sizeof(ARegion), "channels for sequencer");
@ -137,6 +136,7 @@ static SpaceLink *sequencer_create(const ScrArea *UNUSED(area), const Scene *sce
BLI_addtail(&sseq->regionbase, region);
region->regiontype = RGN_TYPE_CHANNELS;
region->alignment = RGN_ALIGN_LEFT;
region->v2d.flag |= V2D_VIEWSYNC_AREA_VERTICAL;
/* Preview region. */
/* NOTE: if you change values here, also change them in sequencer_init_preview_region. */