diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenloader/intern/versioning_280.c | 15 | ||||
-rw-r--r-- | source/blender/editors/space_action/space_action.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 6 |
3 files changed, 23 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index 190b9d86d59..fcc7d39c539 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -1474,5 +1474,20 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } } } + if (!DNA_struct_elem_find(fd->filesdna, "SpaceAction", "char", "mode_prev")) { + for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { + for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { + for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { + if (sl->spacetype == SPACE_ACTION) { + SpaceAction *saction = (SpaceAction *)sl; + /* "Dopesheet" should be default here, unless it looks like the Action Editor was active instead */ + if ((saction->mode_prev == 0) && (saction->action == NULL)) { + saction->mode_prev = SACTCONT_DOPESHEET; + } + } + } + } + } + } } } diff --git a/source/blender/editors/space_action/space_action.c b/source/blender/editors/space_action/space_action.c index 03ab60d554c..31ae47245c5 100644 --- a/source/blender/editors/space_action/space_action.c +++ b/source/blender/editors/space_action/space_action.c @@ -104,6 +104,7 @@ static SpaceLink *action_new(const ScrArea *sa, const Scene *scene) saction->autosnap = SACTSNAP_FRAME; saction->mode = SACTCONT_DOPESHEET; + saction->mode_prev = SACTCONT_DOPESHEET; saction->ads.filterflag |= ADS_FILTER_SUMMARY; @@ -858,6 +859,7 @@ static void action_space_subtype_set(ScrArea *sa, int value) sact->mode = value; } else { + printf("%p mode prev = %d\n", sact, sact->mode_prev); sact->mode = sact->mode_prev; } } diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 3bf55ee2632..6703c43437c 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -1519,6 +1519,12 @@ static void rna_SpaceDopeSheetEditor_mode_update(bContext *C, PointerRNA *ptr) /* recalculate extents of channel list */ saction->flag |= SACTION_TEMP_NEEDCHANSYNC; + + /* store current mode as "old mode", so that returning from other editors doesn't always reset to "Action Editor" */ + if (saction->mode != SACTCONT_TIMELINE) { + printf("%p storing %d as old mode over %d\n", saction, saction->mode, saction->mode_prev); + saction->mode_prev = saction->mode; + } } /* Space Graph Editor */ |