Blender  V3.3
Functions
ED_undo.h File Reference
#include "BLI_compiler_attrs.h"

Go to the source code of this file.

Functions

bool ED_undo_is_state_valid (struct bContext *C)
 
void ED_undo_group_begin (struct bContext *C)
 
void ED_undo_group_end (struct bContext *C)
 
void ED_undo_push (struct bContext *C, const char *str)
 
void ED_undo_push_op (struct bContext *C, struct wmOperator *op)
 
void ED_undo_grouped_push (struct bContext *C, const char *str)
 
void ED_undo_grouped_push_op (struct bContext *C, struct wmOperator *op)
 
void ED_undo_pop_op (struct bContext *C, struct wmOperator *op)
 
void ED_undo_pop (struct bContext *C)
 
void ED_undo_redo (struct bContext *C)
 
void ED_OT_undo (struct wmOperatorType *ot)
 
void ED_OT_undo_push (struct wmOperatorType *ot)
 
void ED_OT_redo (struct wmOperatorType *ot)
 
void ED_OT_undo_redo (struct wmOperatorType *ot)
 
void ED_OT_undo_history (struct wmOperatorType *ot)
 
int ED_undo_operator_repeat (struct bContext *C, struct wmOperator *op)
 
void ED_undo_operator_repeat_cb (struct bContext *C, void *arg_op, void *arg_unused)
 
void ED_undo_operator_repeat_cb_evt (struct bContext *C, void *arg_op, int arg_unused)
 
bool ED_undo_is_valid (const struct bContext *C, const char *undoname)
 
bool ED_undo_is_memfile_compatible (const struct bContext *C)
 
bool ED_undo_is_legacy_compatible_for_property (struct bContext *C, struct ID *id)
 
void ED_undo_object_editmode_restore_helper (struct bContext *C, struct Object **object_array, uint object_array_len, uint object_array_stride)
 
struct Object ** ED_undo_editmode_objects_from_view_layer (struct ViewLayer *view_layer, uint *r_len)
 
struct Base ** ED_undo_editmode_bases_from_view_layer (struct ViewLayer *view_layer, uint *r_len)
 
struct UndoStackED_undo_stack_get (void)
 
void ED_undo_object_set_active_or_warn (struct Scene *scene, struct ViewLayer *view_layer, struct Object *ob, const char *info, struct CLG_LogRef *log)
 
void ED_undosys_type_init (void)
 
void ED_undosys_type_free (void)
 
struct MemFileED_undosys_stack_memfile_get_active (struct UndoStack *ustack)
 
void ED_undosys_stack_memfile_id_changed_tag (struct UndoStack *ustack, struct ID *id)
 

Function Documentation

◆ ED_OT_redo()

void ED_OT_redo ( struct wmOperatorType ot)

◆ ED_OT_undo()

void ED_OT_undo ( struct wmOperatorType ot)

◆ ED_OT_undo_history()

void ED_OT_undo_history ( struct wmOperatorType ot)

◆ ED_OT_undo_push()

void ED_OT_undo_push ( struct wmOperatorType ot)

◆ ED_OT_undo_redo()

void ED_OT_undo_redo ( struct wmOperatorType ot)

◆ ED_undo_editmode_bases_from_view_layer()

struct Base** ED_undo_editmode_bases_from_view_layer ( struct ViewLayer view_layer,
uint r_len 
)

◆ ED_undo_editmode_objects_from_view_layer()

struct Object** ED_undo_editmode_objects_from_view_layer ( struct ViewLayer view_layer,
uint r_len 
)

◆ ED_undo_group_begin()

void ED_undo_group_begin ( struct bContext C)

◆ ED_undo_group_end()

void ED_undo_group_end ( struct bContext C)

◆ ED_undo_grouped_push()

void ED_undo_grouped_push ( struct bContext C,
const char *  str 
)

◆ ED_undo_grouped_push_op()

void ED_undo_grouped_push_op ( struct bContext C,
struct wmOperator op 
)

◆ ED_undo_is_legacy_compatible_for_property()

bool ED_undo_is_legacy_compatible_for_property ( struct bContext C,
struct ID id 
)

When a property of ID changes, return false.

This is to avoid changes to a property making undo pushes which are ignored by the undo-system. For example, changing a brush property isn't stored by sculpt-mode undo steps. This workaround is needed until the limitation is removed, see: T61948.

Definition at line 448 of file ed_undo.c.

References C, CLOG_INFO, CTX_data_view_layer(), Object::data, GS, id, LOG, Object::mode, ID::name, NULL, OB_MODE_ALL_PAINT, OB_MODE_EDIT, and OBACT.

Referenced by radial_control_modal(), and ui_apply_but_undo().

◆ ED_undo_is_memfile_compatible()

bool ED_undo_is_memfile_compatible ( const struct bContext C)

◆ ED_undo_is_state_valid()

bool ED_undo_is_state_valid ( struct bContext C)

Run from the main event loop, basic checks that undo is left in a correct state.

Definition at line 65 of file ed_undo.c.

References C, CTX_wm_manager(), UndoStack::group_level, NULL, UndoStep::skip, UndoStack::step_active, and wmWindowManager::undo_stack.

Referenced by wm_event_do_handlers().

◆ ED_undo_is_valid()

bool ED_undo_is_valid ( const struct bContext C,
const char *  undoname 
)

Name optionally, function used to check for operator redo panel.

Referenced by WM_operator_check_ui_enabled().

◆ ED_undo_object_editmode_restore_helper()

void ED_undo_object_editmode_restore_helper ( struct bContext C,
struct Object **  object_array,
uint  object_array_len,
uint  object_array_stride 
)

◆ ED_undo_object_set_active_or_warn()

void ED_undo_object_set_active_or_warn ( struct Scene scene,
struct ViewLayer view_layer,
struct Object ob,
const char *  info,
struct CLG_LogRef log 
)

◆ ED_undo_operator_repeat()

int ED_undo_operator_repeat ( struct bContext C,
struct wmOperator op 
)

◆ ED_undo_operator_repeat_cb()

void ED_undo_operator_repeat_cb ( struct bContext C,
void arg_op,
void arg_unused 
)

Convenience since UI callbacks use this mostly.

◆ ED_undo_operator_repeat_cb_evt()

void ED_undo_operator_repeat_cb_evt ( struct bContext C,
void arg_op,
int  arg_unused 
)

◆ ED_undo_pop()

void ED_undo_pop ( struct bContext C)

Definition at line 395 of file ed_undo.c.

References C, ed_undo_step_direction(), NULL, and STEP_UNDO.

Referenced by redraw_timer_step().

◆ ED_undo_pop_op()

void ED_undo_pop_op ( struct bContext C,
struct wmOperator op 
)

◆ ED_undo_push()

void ED_undo_push ( struct bContext C,
const char *  str 
)

Definition at line 100 of file ed_undo.c.

References BKE_undosys_print(), BKE_undosys_stack_limit_steps_and_memory(), BKE_undosys_step_push(), C, CLOG_CHECK, CLOG_INFO, CTX_wm_manager(), G, LOG, memory_limit, NC_WM, ND_LIB_OVERRIDE_CHANGED, UndoStep::next, NULL, UndoStack::step_active, UndoStack::step_init, steps, str, UNDO_PUSH_RET_OVERRIDE_CHANGED, wmWindowManager::undo_stack, WM_file_tag_modified(), and WM_main_add_notifier().

Referenced by blender::ed::space_node::attribute_search_exec_fn(), attribute_search_exec_fn(), colorband_add_cb(), colorband_del_cb(), colorband_distribute_cb(), colorband_flip_cb(), colorband_tools_dofunc(), curvemap_tools_dofunc(), CurveProfile_presets_dofunc(), CurveProfile_tools_dofunc(), delete_fmodifier_cb(), do_outliner_item_editmode_toggle(), do_outliner_item_mode_toggle_generic(), do_outliner_item_posemode_toggle(), driver_add_var_cb(), driver_delete_var_cb(), blender::ed::asset_browser::AssetCatalogDropController::drop_assets_into_catalog(), ED_sculpt_undo_push_multires_mesh_end(), ED_undo_grouped_push(), ed_undo_push_exec(), ED_undo_push_op(), eyedropper_add_material(), file_browse_exec(), fmodifier_reorder(), import_endjob(), object_transfer_mode_to_base(), outliner_action_set_exec(), outliner_animdata_operation_exec(), outliner_constraint_operation_exec(), outliner_data_operation_exec(), outliner_id_operation_exec(), outliner_lib_operation_exec(), outliner_liboverride_operation_exec(), outliner_modifier_operation_exec(), outliner_object_operation_exec(), outliner_scene_operation_exec(), radial_control_modal(), template_id_cb(), text_autocomplete_invoke(), text_autocomplete_modal(), ui_apply_but_funcs_after(), blender::ed::space_node::ui_node_link(), view3d_camera_lock_undo_ex(), and view3d_collection_drop_copy_external_asset().

◆ ED_undo_push_op()

void ED_undo_push_op ( struct bContext C,
struct wmOperator op 
)

◆ ED_undo_redo()

void ED_undo_redo ( struct bContext C)

Definition at line 399 of file ed_undo.c.

References C, ed_undo_step_direction(), NULL, and STEP_REDO.

Referenced by ED_undo_operator_repeat(), and redraw_timer_step().

◆ ED_undo_stack_get()

struct UndoStack* ED_undo_stack_get ( void  )

◆ ED_undosys_stack_memfile_get_active()

struct MemFile* ED_undosys_stack_memfile_get_active ( struct UndoStack ustack)

◆ ED_undosys_stack_memfile_id_changed_tag()

void ED_undosys_stack_memfile_id_changed_tag ( struct UndoStack ustack,
struct ID id 
)

If the last undo step is a memfile one, find the first MemFileChunk matching given ID (using its session UUID), and tag it as "changed in the future".

Since non-memfile undo-steps cannot automatically set this flag in the previous step as done with memfile ones, this has to be called manually by relevant undo code.

Note
Only current known case for this is undoing a switch from Object to Sculpt mode (see T82388).
Calling this ID by ID is not optimal, as it will loop over all MemFile.chunks until it finds the expected one. If this becomes an issue we'll have to add a mapping from session UUID to first MemFileChunk in MemFile itself (currently we only do that in MemFileWriteData when writing a new step).

Definition at line 352 of file memfile_undo.c.

References BKE_UNDOSYS_TYPE_MEMFILE, MemFile::chunks, id, LISTBASE_FOREACH, NULL, ID::session_uuid, UndoStack::step_active, and UndoStep::type.

Referenced by SCULPT_undo_push_begin().

◆ ED_undosys_type_free()

void ED_undosys_type_free ( void  )

Definition at line 52 of file undo_system_types.c.

References BKE_undosys_type_free_all().

Referenced by WM_exit_ex().

◆ ED_undosys_type_init()

void ED_undosys_type_init ( void  )