diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-04-03 15:19:51 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-04-03 15:19:51 +0300 |
commit | a2c0a382cd00b9b1a3058ad0017887e451b73465 (patch) | |
tree | be978c24be659a22afb22eb53c52c468e4087c06 /source/blender/editors/undo | |
parent | feb7852e1ba55b4c7f697ec52fee672a8cc2261c (diff) | |
parent | b3004d30f5d5060035c5f8ac4cb6338463872877 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/editors/undo')
-rw-r--r-- | source/blender/editors/undo/ed_undo.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/editors/undo/ed_undo.c b/source/blender/editors/undo/ed_undo.c index 691ba066bf9..4f62e38dc0b 100644 --- a/source/blender/editors/undo/ed_undo.c +++ b/source/blender/editors/undo/ed_undo.c @@ -42,6 +42,7 @@ #include "BKE_blender_undo.h" #include "BKE_context.h" #include "BKE_global.h" +#include "BKE_main.h" #include "BKE_screen.h" #include "BKE_undo_system.h" @@ -190,6 +191,19 @@ bool ED_undo_is_valid(const bContext *C, const char *undoname) return BKE_undosys_stack_has_undo(wm->undo_stack, undoname); } +/** + * Ideally we wont access the stack directly, + * this is needed for modes which handle undo themselves (bypassing #ED_undo_push). + * + * Using global isn't great, this just avoids doing inline, + * causing 'BKE_global.h' & 'BKE_main.h' includes. + */ +UndoStack *ED_undo_stack_get(void) +{ + wmWindowManager *wm = G.main->wm.first; + return wm->undo_stack; +} + /** \} */ /* -------------------------------------------------------------------- */ |