diff options
author | Joshua Leung <aligorith@gmail.com> | 2018-06-21 07:07:47 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2018-06-21 07:07:47 +0300 |
commit | 417856dae5f072fae929e2a979cc31504f934558 (patch) | |
tree | b39eb6dd800fddef8ccfc7d99bfc9ca768692ced /source/blender/makesrna/intern | |
parent | ed428b2c04cda06011ddb37df1b49ce0a8847ef2 (diff) |
Fix: Incorrect submodes being set in Dopesheet/Action Editor when changing modes
This commit fixes a number of problematic corner cases when switching between
editors after 2b5050a4cdfbb075d360fd39433acea07432c60b
The root cause of these issues was that mode_prev was not being set in
many cases, resulting in mode changes to the Timeline and back (via other
editors) causing Dopesheet Editors to reset back to "Action Editor" mode.
1) Creating new Dopesheet Editors (e.g. change the default 3D view to
a Dopesheet editor) would default to displaying the "Action Editor",
since mode/mode_prev == 0 represents the "Action Editor" (for backwards
compatability reasons), while mode == 3 is for the "Dopesheet"
2) If you set the Dopesheet Editor to another mode (e.g. "Grease Pencil" mode),
change to another editor (e.g. Shaders), then come back, the mode would
get reset to "Action Editor".
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 6 |
1 files changed, 6 insertions, 0 deletions
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 */ |