Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/paint_curve_undo.c
| Show All 28 Lines | |||||
| #include "DNA_brush_types.h" | #include "DNA_brush_types.h" | ||||
| #include "DNA_space_types.h" | #include "DNA_space_types.h" | ||||
| #include "BLI_string.h" | #include "BLI_string.h" | ||||
| #include "BLI_array_utils.h" | #include "BLI_array_utils.h" | ||||
| #include "BKE_context.h" | #include "BKE_context.h" | ||||
| #include "BKE_paint.h" | #include "BKE_paint.h" | ||||
| #include "BKE_global.h" | |||||
| #include "BKE_main.h" | |||||
| #include "BKE_undo_system.h" | #include "BKE_undo_system.h" | ||||
| #include "ED_paint.h" | #include "ED_paint.h" | ||||
| #include "ED_undo.h" | |||||
| #include "WM_api.h" | #include "WM_api.h" | ||||
| #include "WM_types.h" | #include "WM_types.h" | ||||
| #include "paint_intern.h" | #include "paint_intern.h" | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name Undo Conversion | /** \name Undo Conversion | ||||
| ▲ Show 20 Lines • Show All 100 Lines • ▼ Show 20 Lines | |||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name Utilities | /** \name Utilities | ||||
| * \{ */ | * \{ */ | ||||
| void ED_paintcurve_undo_push_begin(const char *name) | void ED_paintcurve_undo_push_begin(const char *name) | ||||
| { | { | ||||
| UndoStack *ustack = ED_undo_stack_get(); | |||||
| bContext *C = NULL; /* special case, we never read from this. */ | bContext *C = NULL; /* special case, we never read from this. */ | ||||
| wmWindowManager *wm = G.main->wm.first; | BKE_undosys_step_push_init_with_type(ustack, C, name, BKE_UNDOSYS_TYPE_PAINTCURVE); | ||||
| BKE_undosys_step_push_init_with_type(wm->undo_stack, C, name, BKE_UNDOSYS_TYPE_PAINTCURVE); | |||||
| } | } | ||||
| void ED_paintcurve_undo_push_end(void) | void ED_paintcurve_undo_push_end(void) | ||||
| { | { | ||||
| wmWindowManager *wm = G.main->wm.first; /* XXX, avoids adding extra arg. */ | UndoStack *ustack = ED_undo_stack_get(); | ||||
| BKE_undosys_step_push(wm->undo_stack, NULL, NULL); | BKE_undosys_step_push(ustack, NULL, NULL); | ||||
| } | } | ||||
| /** \} */ | /** \} */ | ||||