157 if (
U.undomemory != 0) {
158 const size_t memory_limit = (size_t)
U.undomemory * 1024 * 1024;
191 BKE_report(reports,
RPT_INFO,
"Checking sanity of current .blend file *BEFORE* undo step");
260 BKE_report(reports,
RPT_INFO,
"Checking sanity of current .blend file *AFTER* undo step");
329 if (undo_step_from_name ==
NULL) {
330 CLOG_ERROR(&
LOG,
"Step name='%s' not found in current undo stack", undo_name);
336 if (undo_step_target ==
NULL) {
337 CLOG_ERROR(&
LOG,
"Step name='%s' cannot be undone", undo_name);
348 "name='%s', found direction=%s",
350 (undo_dir ==
STEP_UNDO) ?
"STEP_UNDO" :
"STEP_REDO");
381 "index='%d', found direction=%s",
383 (undo_dir ==
STEP_UNDO) ?
"STEP_UNDO" :
"STEP_REDO");
450 if (view_layer !=
NULL) {
472 if (view_layer !=
NULL) {
632 "Add an undo step *function may be moved*",
662 ot->
name =
"Undo and Redo";
705 printf(
"redo_cb: operator redo %s\n", op->
type->
name);
725 printf(
"redo_cb: operator redo failed: %s, return %d\n", op->
type->
name, retval);
735 printf(
"redo_cb: WM_operator_repeat_check returned false %s\n", op->
type->
name);
777 if (us->skip ==
false) {
781 item_tmp.
icon = ICON_LAYER_ACTIVE;
784 item_tmp.
icon = ICON_NONE;
808 const int col_size = 20 + totitem / 12;
812 for (
c = 0, i = totitem; i--;) {
813 if (add_col && !(
c % col_size)) {
817 if (item[i].identifier) {
859 ot->
name =
"Undo History";
884 view_layer->
basact = base;
899 uint object_array_len,
900 uint object_array_stride)
908 for (
uint i = 0; i < bases_len; i++) {
912 Object **ob_p = object_array;
913 for (
uint i = 0; i < object_array_len; i++, ob_p =
POINTER_OFFSET(ob_p, object_array_stride)) {
918 for (
uint i = 0; i < bases_len; i++) {
944 const short object_type = obact->
type;
947 Object *ob = base->object;
956 Object *ob = base->object;
975 const short object_type = baseact->
object->
type;
980 for (
Base *base = baseact, *base_next =
FIRSTBASE(view_layer); base;
981 base = base_next, base_next = base_next ? base_next->next :
NULL) {
982 Object *ob = base->object;
1004 const short object_type = baseact->
object->
type;
1010 base = base_next, base_next = base_next ? base_next->next :
NULL) {
1011 Object *ob = base->object;
1015 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, ReportType type, const char *message)
struct ARegion * BKE_area_find_region_active_win(struct ScrArea *area)
void BKE_undosys_stack_clear_active(UndoStack *ustack)
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)
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
bool BKE_undosys_stack_has_undo(UndoStack *ustack, const char *name)
void BKE_undosys_stack_group_end(UndoStack *ustack)
bool BKE_undosys_step_load_data_ex(UndoStack *ustack, struct bContext *C, UndoStep *us_target, UndoStep *us_reference, const bool use_skip)
bool BKE_undosys_step_redo(UndoStack *ustack, struct bContext *C)
UndoPushReturn BKE_undosys_step_push(UndoStack *ustack, struct bContext *C, const char *name)
void BKE_undosys_step_load_from_index(UndoStack *ustack, struct bContext *C, const int index)
void BKE_undosys_print(UndoStack *ustack)
void BKE_undosys_stack_group_begin(UndoStack *ustack)
#define LISTBASE_FOREACH(type, var, list)
int BLI_listbase_count_at_most(const struct ListBase *listbase, const int count_max) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define POINTER_OFFSET(v, ofs)
Utils 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_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.
uiLayout * uiLayoutColumn(uiLayout *layout, bool align)
void uiItemIntO(uiLayout *layout, const char *name, int icon, const char *opname, const char *propname, int value)
struct uiLayout * UI_popup_menu_layout(uiPopupMenu *pup)
uiLayout * uiLayoutSplit(uiLayout *layout, float percentage, bool align)
void UI_popup_menu_end(struct bContext *C, struct uiPopupMenu *pup)
uiPopupMenu * UI_popup_menu_begin(struct bContext *C, const char *title, int icon) ATTR_NONNULL()
#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)
static const EnumPropertyItem * rna_undo_itemf(bContext *C, int *totitem)
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 bool undo_history_poll(bContext *C)
static void ed_undo_step_post(bContext *C, wmWindowManager *wm, const enum eUndoStepDir undo_dir, ReportList *reports)
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)
INLINE Rall1d< T, V, S > log(const Rall1d< T, V, S > &arg)
static void area(int d1, int d2, int e1, int e2, float weights[2])
void split(const std::string &s, const char delim, std::vector< std::string > &tokens)
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)
void RNA_enum_item_end(EnumPropertyItem **items, int *totitem)
void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
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)
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)
bool WM_jobs_test(wmWindowManager *wm, void *owner, int job_type)
void WM_jobs_kill_all(wmWindowManager *wm)
const char * WM_operatortype_name(struct wmOperatorType *ot, struct PointerRNA *properties)
bool WM_operator_check_ui_enabled(const bContext *C, const char *idname)
wmOperator * WM_operator_last_redo(const bContext *C)