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:
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt_undo.c')
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_undo.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt_undo.c b/source/blender/editors/sculpt_paint/sculpt_undo.c
index 4e2bcab9f36..e90d2b58c0c 100644
--- a/source/blender/editors/sculpt_paint/sculpt_undo.c
+++ b/source/blender/editors/sculpt_paint/sculpt_undo.c
@@ -59,8 +59,6 @@
#include "BKE_key.h"
#include "BKE_mesh.h"
#include "BKE_subsurf.h"
-#include "BKE_global.h"
-#include "BKE_main.h"
#include "BKE_undo_system.h"
#include "WM_api.h"
@@ -71,6 +69,7 @@
#include "ED_paint.h"
#include "ED_object.h"
#include "ED_sculpt.h"
+#include "ED_undo.h"
#include "bmesh.h"
#include "paint_intern.h"
@@ -974,9 +973,9 @@ SculptUndoNode *sculpt_undo_push_node(
void sculpt_undo_push_begin(const char *name)
{
+ UndoStack *ustack = ED_undo_stack_get();
bContext *C = NULL; /* special case, we never read from this. */
- wmWindowManager *wm = G.main->wm.first;
- BKE_undosys_step_push_init_with_type(wm->undo_stack, C, name, BKE_UNDOSYS_TYPE_SCULPT);
+ BKE_undosys_step_push_init_with_type(ustack, C, name, BKE_UNDOSYS_TYPE_SCULPT);
}
void sculpt_undo_push_end(void)
@@ -995,8 +994,8 @@ void sculpt_undo_push_end(void)
BKE_pbvh_node_layer_disp_free(unode->node);
}
- wmWindowManager *wm = G.main->wm.first; /* XXX, avoids adding extra arg. */
- BKE_undosys_step_push(wm->undo_stack, NULL, NULL);
+ UndoStack *ustack = ED_undo_stack_get();
+ BKE_undosys_step_push(ustack, NULL, NULL);
}
/* -------------------------------------------------------------------- */
@@ -1083,8 +1082,8 @@ static UndoSculpt *sculpt_undosys_step_get_nodes(UndoStep *us_p)
static UndoSculpt *sculpt_undo_get_nodes(void)
{
- wmWindowManager *wm = G.main->wm.first; /* XXX, avoids adding extra arg. */
- UndoStep *us = BKE_undosys_stack_init_or_active_with_type(wm->undo_stack, BKE_UNDOSYS_TYPE_SCULPT);
+ UndoStack *ustack = ED_undo_stack_get();
+ UndoStep *us = BKE_undosys_stack_init_or_active_with_type(ustack, BKE_UNDOSYS_TYPE_SCULPT);
return sculpt_undosys_step_get_nodes(us);
}