Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Antalik <richardantalik@gmail.com>2022-06-24 11:23:31 +0300
committerRichard Antalik <richardantalik@gmail.com>2022-06-24 11:23:31 +0300
commite08c9324823b24168cdf278c5c9b7ec519335112 (patch)
treea3c95f37303f729b1be7b0f05d63bb6f8f3b9d63 /source/blender/blenloader
parent3323cd9c9aa07cfc131b295977cd921fe7c547f0 (diff)
Fix T98925: Editor panels are broken
Commit 277fa2f441f4 added channels region to unintended editors if sequencer was used in area. This caused issues with some editors having 2 tool regions and non functioning side panel. Reviewed By: campbellbarton Differential Revision: https://developer.blender.org/D15253
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/versioning_300.c33
1 files changed, 29 insertions, 4 deletions
diff --git a/source/blender/blenloader/intern/versioning_300.c b/source/blender/blenloader/intern/versioning_300.c
index 844354c8bc3..57fd71f8933 100644
--- a/source/blender/blenloader/intern/versioning_300.c
+++ b/source/blender/blenloader/intern/versioning_300.c
@@ -798,13 +798,16 @@ void do_versions_after_linking_300(Main *bmain, ReportList *UNUSED(reports))
continue;
}
SpaceSeq *sseq = (SpaceSeq *)sl;
+ ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase :
+ &sl->regionbase;
sseq->flag |= SEQ_CLAMP_VIEW;
if (ELEM(sseq->view, SEQ_VIEW_PREVIEW, SEQ_VIEW_SEQUENCE_PREVIEW)) {
continue;
}
- ARegion *timeline_region = BKE_area_find_region_type(area, RGN_TYPE_WINDOW);
+ ARegion *timeline_region = BKE_region_find_in_listbase_by_type(regionbase,
+ RGN_TYPE_WINDOW);
if (timeline_region == NULL) {
continue;
@@ -2869,16 +2872,19 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain)
ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase :
&sl->regionbase;
- ARegion *region = BKE_area_find_region_type(area, RGN_TYPE_CHANNELS);
+ ARegion *region = BKE_region_find_in_listbase_by_type(regionbase, RGN_TYPE_CHANNELS);
if (!region) {
- ARegion *tools_region = BKE_area_find_region_type(area, RGN_TYPE_TOOLS);
+ /* Find sequencer tools region. */
+ ARegion *tools_region = BKE_region_find_in_listbase_by_type(regionbase,
+ 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);
+ ARegion *timeline_region = BKE_region_find_in_listbase_by_type(regionbase,
+ RGN_TYPE_WINDOW);
if (timeline_region != NULL) {
timeline_region->v2d.flag |= V2D_VIEWSYNC_AREA_VERTICAL;
}
@@ -3176,5 +3182,24 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain)
*/
{
/* Keep this block, even when empty. */
+
+ /* Fix for T98925 - remove channels region, that was initialized in incorrect editor types. */
+ for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
+ LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
+ LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
+ if (ELEM(sl->spacetype, SPACE_ACTION, SPACE_CLIP, SPACE_GRAPH, SPACE_NLA, SPACE_SEQ)) {
+ continue;
+ }
+
+ ListBase *regionbase = (sl == area->spacedata.first) ? &area->regionbase :
+ &sl->regionbase;
+ ARegion *channels_region = BKE_region_find_in_listbase_by_type(regionbase,
+ RGN_TYPE_CHANNELS);
+ if (channels_region) {
+ BLI_freelinkN(regionbase, channels_region);
+ }
+ }
+ }
+ }
}
}