140 if (
U.undomemory != 0) {
141 const size_t memory_limit = (size_t)
U.undomemory * 1024 * 1024;
174 BKE_report(reports,
RPT_INFO,
"Checking sanity of current .blend file *BEFORE* undo step");
243 BKE_report(reports,
RPT_INFO,
"Checking sanity of current .blend file *AFTER* undo step");
314 if (undo_step_from_name ==
NULL) {
315 CLOG_ERROR(&
LOG,
"Step name='%s' not found in current undo stack", undo_name);
321 if (undo_step_target ==
NULL) {
322 CLOG_ERROR(&
LOG,
"Step name='%s' cannot be undone", undo_name);
333 "name='%s', found direction=%s",
335 (undo_dir ==
STEP_UNDO) ?
"STEP_UNDO" :
"STEP_REDO");
362 if (undo_index == active_step_index) {
369 "index='%d', found direction=%s",
371 (undo_dir ==
STEP_UNDO) ?
"STEP_UNDO" :
"STEP_REDO");
437 if (view_layer !=
NULL) {
451 if (view_layer !=
NULL) {
558 "Undo disabled at startup in background-mode "
559 "(call `ed.undo_push()` to explicitly initialize the undo-system)");
617 "Add an undo step *function may be moved*",
647 ot->
name =
"Undo and Redo";
689 printf(
"redo_cb: operator redo %s\n", op->
type->
name);
709 printf(
"redo_cb: operator redo failed: %s, return %d\n", op->
type->
name, retval);
719 printf(
"redo_cb: WM_operator_repeat_check returned false %s\n", op->
type->
name);
782 ot->
name =
"Undo History";
807 view_layer->
basact = base;
819 uint object_array_len,
820 uint object_array_stride)
828 for (
uint i = 0; i < bases_len; i++) {
832 Object **ob_p = object_array;
833 for (
uint i = 0; i < object_array_len; i++, ob_p =
POINTER_OFFSET(ob_p, object_array_stride)) {
838 for (
uint i = 0; i < bases_len; i++) {
864 const short object_type = obact->
type;
867 Object *ob = base->object;
876 Object *ob = base->object;
895 const short object_type = baseact->
object->
type;
900 for (
Base *base = baseact, *base_next =
FIRSTBASE(view_layer); base;
901 base = base_next, base_next = base_next ? base_next->next :
NULL) {
902 Object *ob = base->object;
924 const short object_type = baseact->
object->
type;
930 base = base_next, base_next = base_next ? base_next->next :
NULL) {
931 Object *ob = base->object;
935 base_array[i++] = base;
void BKE_callback_exec_id(struct Main *bmain, struct ID *id, eCbEvent evt)
struct ScrArea * CTX_wm_area(const bContext *C)
struct Scene * CTX_data_scene(const bContext *C)
void CTX_wm_region_set(bContext *C, struct ARegion *region)
struct ARegion * CTX_wm_menu(const bContext *C)
struct Base * CTX_data_active_base(const bContext *C)
struct wmWindowManager * CTX_wm_manager(const bContext *C)
struct ViewLayer * CTX_data_view_layer(const bContext *C)
struct Object * CTX_data_active_object(const bContext *C)
struct ARegion * CTX_wm_region(const bContext *C)
void CTX_wm_operator_poll_msg_set(struct bContext *C, const char *msg)
struct Main * CTX_data_main(const bContext *C)
struct wmWindow * CTX_wm_window(const bContext *C)
struct Base * BKE_view_layer_base_find(struct ViewLayer *view_layer, struct Object *ob)
void BKE_report(ReportList *reports, eReportType type, const char *message)
struct ARegion * BKE_area_find_region_active_win(struct ScrArea *area)
bool BKE_undosys_stack_has_undo(const UndoStack *ustack, const char *name)
void BKE_undosys_stack_clear_active(UndoStack *ustack)
eUndoPushReturn BKE_undosys_step_push(UndoStack *ustack, struct bContext *C, const char *name)
UndoStack * BKE_undosys_stack_create(void)
eUndoStepDir BKE_undosys_step_calc_direction(const UndoStack *ustack, const UndoStep *us_target, const UndoStep *us_reference)
bool BKE_undosys_step_undo(UndoStack *ustack, struct bContext *C)
bool BKE_undosys_step_load_data_ex(UndoStack *ustack, struct bContext *C, UndoStep *us_target, UndoStep *us_reference, bool use_skip)
UndoStep * BKE_undosys_step_find_by_name(UndoStack *ustack, const char *name)
void BKE_undosys_stack_limit_steps_and_memory(UndoStack *ustack, int steps, size_t memory_limit)
@ UNDO_PUSH_RET_OVERRIDE_CHANGED
void BKE_undosys_stack_group_end(UndoStack *ustack)
void BKE_undosys_step_load_from_index(UndoStack *ustack, struct bContext *C, int index)
bool BKE_undosys_step_redo(UndoStack *ustack, struct bContext *C)
void BKE_undosys_print(UndoStack *ustack)
void BKE_undosys_stack_group_begin(UndoStack *ustack)
#define BLI_assert_msg(a, msg)
#define LISTBASE_FOREACH(type, var, list)
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define POINTER_OFFSET(v, ofs)
Utilities ensuring .blend file (i.e. Main) is in valid state during write and/or read process.
bool BLO_main_validate_libraries(struct Main *bmain, struct ReportList *reports)
#define CLOG_ERROR(clg_ref,...)
#define CLOG_WARN(clg_ref,...)
#define CLOG_CHECK(clg_ref, verbose_level,...)
#define CLOG_INFO(clg_ref, level,...)
#define OB_MODE_ALL_PAINT
Object is a sort of wrapper for general info.
#define FIRSTBASE(_view_layer)
#define BASACT(_view_layer)
#define OBACT(_view_layer)
void ED_assetlist_storage_tag_main_data_dirty(void)
void ED_object_base_select(struct Base *base, eObjectSelect_Mode mode)
void ED_object_base_active_refresh(struct Main *bmain, struct Scene *scene, struct ViewLayer *view_layer)
bool ED_object_editmode_exit_ex(struct Main *bmain, struct Scene *scene, struct Object *obedit, int flag)
bool ED_object_editmode_enter_ex(struct Main *bmain, struct Scene *scene, struct Object *ob, int flag)
void ED_object_base_activate(struct bContext *C, struct Base *base)
void ED_outliner_select_sync_from_all_tag(struct bContext *C)
bool ED_operator_screenactive(struct bContext *C)
void ED_region_tag_refresh_ui(struct ARegion *region)
Read Guarded memory(de)allocation.
#define ND_LIB_OVERRIDE_CHANGED
void ED_undo_object_set_active_or_warn(Scene *scene, ViewLayer *view_layer, Object *ob, const char *info, CLG_LogRef *log)
void ED_undo_push(bContext *C, const char *str)
void ED_OT_redo(wmOperatorType *ot)
bool ED_undo_is_legacy_compatible_for_property(struct bContext *C, ID *id)
static int ed_undo_push_exec(bContext *C, wmOperator *op)
static void ed_undo_step_pre(bContext *C, wmWindowManager *wm, const enum eUndoStepDir undo_dir, ReportList *reports)
void ED_undo_push_op(bContext *C, wmOperator *op)
UndoStack * ED_undo_stack_get(void)
void ED_undo_pop_op(bContext *C, wmOperator *op)
Base ** ED_undo_editmode_bases_from_view_layer(ViewLayer *view_layer, uint *r_len)
void ED_undo_group_begin(bContext *C)
bool ED_undo_is_valid(const bContext *C, const char *undoname)
void ED_OT_undo_redo(wmOperatorType *ot)
static int ed_undo_step_by_index(bContext *C, const int undo_index, ReportList *reports)
static int undo_editmode_objects_from_view_layer_prepare(ViewLayer *view_layer, Object *obact)
void ED_OT_undo_push(wmOperatorType *ot)
int ED_undo_operator_repeat(bContext *C, wmOperator *op)
static void ed_undo_step_post(bContext *C, wmWindowManager *wm, const enum eUndoStepDir undo_dir, ReportList *reports)
static void ed_undo_refresh_for_op(bContext *C)
void ED_undo_operator_repeat_cb_evt(bContext *C, void *arg_op, int UNUSED(arg_unused))
static int ed_undo_exec(bContext *C, wmOperator *op)
static int undo_history_exec(bContext *C, wmOperator *op)
static bool ed_redo_poll(bContext *C)
void ED_undo_operator_repeat_cb(bContext *C, void *arg_op, void *UNUSED(arg_unused))
static bool ed_undo_is_init_poll(bContext *C)
static bool ed_undo_is_init_and_screenactive_poll(bContext *C)
Object ** ED_undo_editmode_objects_from_view_layer(ViewLayer *view_layer, uint *r_len)
static int ed_redo_exec(bContext *C, wmOperator *op)
static int ed_undo_step_by_name(bContext *C, const char *undo_name, ReportList *reports)
void ED_undo_redo(bContext *C)
static int ed_undo_redo_exec(bContext *C, wmOperator *UNUSED(op))
bool ED_undo_is_state_valid(bContext *C)
void ED_undo_object_editmode_restore_helper(struct bContext *C, Object **object_array, uint object_array_len, uint object_array_stride)
void ED_OT_undo(wmOperatorType *ot)
static int undo_history_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
static int ed_undo_step_direction(bContext *C, enum eUndoStepDir step, ReportList *reports)
void ED_OT_undo_history(wmOperatorType *ot)
static bool ed_undo_poll(bContext *C)
void ED_undo_grouped_push_op(bContext *C, wmOperator *op)
static bool ed_undo_redo_poll(bContext *C)
bool ED_undo_is_memfile_compatible(const bContext *C)
void ED_undo_pop(bContext *C)
void ED_undo_group_end(bContext *C)
void ED_undo_grouped_push(bContext *C, const char *str)
int ED_gpencil_session_active(void)
int ED_undo_gpencil_step(bContext *C, const int step)
void ED_gpencil_toggle_brush_cursor(bContext *C, bool enable, void *customdata)
void *(* MEM_malloc_arrayN)(size_t len, size_t size, const char *str)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_mallocN)(size_t len, const char *str)
ccl_device_inline float3 log(float3 v)
static void area(int d1, int d2, int e1, int e2, float weights[2])
bool RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
int RNA_property_int_get(PointerRNA *ptr, PropertyRNA *prop)
void RNA_string_get(PointerRNA *ptr, const char *name, char *value)
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, int default_value, int hardmin, int hardmax, const char *ui_name, const char *ui_description, int softmin, int softmax)
vector< Object * > objects
struct UndoStep * step_active
struct UndoStep * step_init
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
bool(* check)(struct bContext *, struct wmOperator *)
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
struct wmOperatorType * type
struct UndoStack * undo_stack
void WM_operator_stack_clear(wmWindowManager *wm)
void WM_operator_free_all_after(wmWindowManager *wm, struct wmOperator *op)
void WM_menu_name_call(bContext *C, const char *menu_name, short context)
bool WM_operator_poll(bContext *C, wmOperatorType *ot)
void WM_main_add_notifier(unsigned int type, void *reference)
int WM_operator_repeat(bContext *C, wmOperator *op)
bool WM_operator_repeat_check(const bContext *UNUSED(C), wmOperator *op)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
void WM_event_add_mousemove(wmWindow *win)
void WM_file_tag_modified(void)
void WM_jobs_kill_all(wmWindowManager *wm)
bool WM_jobs_test(const wmWindowManager *wm, const void *owner, int job_type)
bool WM_operator_check_ui_enabled(const bContext *C, const char *idname)
wmOperator * WM_operator_last_redo(const bContext *C)