|
Blender
V2.93
|
#include "BLI_sys_types.h"#include "BLI_utildefines.h"#include "BLI_ghash.h"#include "BLI_listbase.h"#include "DNA_ID.h"#include "DNA_collection_types.h"#include "DNA_node_types.h"#include "DNA_object_enums.h"#include "DNA_object_types.h"#include "DNA_scene_types.h"#include "BKE_blender_undo.h"#include "BKE_context.h"#include "BKE_lib_id.h"#include "BKE_lib_query.h"#include "BKE_main.h"#include "BKE_node.h"#include "BKE_scene.h"#include "BKE_undo_system.h"#include "../depsgraph/DEG_depsgraph.h"#include "WM_api.h"#include "WM_types.h"#include "ED_object.h"#include "ED_undo.h"#include "ED_util.h"#include "../blenloader/BLO_undofile.h"#include "undo_intern.h"#include <stdio.h>Go to the source code of this file.
Classes | |
| struct | MemFileUndoStep |
Functions | |
Utilities | |
| static struct MemFile * | ed_undosys_step_get_memfile (UndoStep *us_p) |
| struct MemFile * | ED_undosys_stack_memfile_get_active (UndoStack *ustack) |
| void | ED_undosys_stack_memfile_id_changed_tag (UndoStack *ustack, ID *id) |
Implements ED Undo System | |
| typedef struct MemFileUndoStep | MemFileUndoStep |
| static bool | memfile_undosys_poll (bContext *C) |
| static bool | memfile_undosys_step_encode (struct bContext *UNUSED(C), struct Main *bmain, UndoStep *us_p) |
| static int | memfile_undosys_step_id_reused_cb (LibraryIDLinkCallbackData *cb_data) |
| static void | memfile_undosys_step_decode (struct bContext *C, struct Main *bmain, UndoStep *us_p, const eUndoStepDir undo_direction, bool UNUSED(is_final)) |
| static void | memfile_undosys_step_free (UndoStep *us_p) |
| void | ED_memfile_undosys_type (UndoType *ut) |
Wrapper between 'ED_undo.h' and 'BKE_undo_system.h' API's.
Definition in file memfile_undo.c.
| typedef struct MemFileUndoStep MemFileUndoStep |
| void ED_memfile_undosys_type | ( | UndoType * | ut | ) |
Definition at line 275 of file memfile_undo.c.
References UndoType::flags, memfile_undosys_poll(), memfile_undosys_step_decode(), memfile_undosys_step_encode(), memfile_undosys_step_free(), UndoType::name, UndoType::poll, UndoType::step_decode, UndoType::step_encode, UndoType::step_free, and UndoType::step_size.
Referenced by ED_undosys_type_init().
Definition at line 304 of file memfile_undo.c.
References BKE_undosys_stack_active_with_type(), BKE_UNDOSYS_TYPE_MEMFILE, ed_undosys_step_get_memfile(), and NULL.
Referenced by wm_autosave_write(), and WM_exit_ex().
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.
Definition at line 328 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().
Ideally we wouldn't need to export global undo internals, there are some cases where it's needed though.
Definition at line 298 of file memfile_undo.c.
References MemFileUndoStep::data, and MemFileUndoData::memfile.
Referenced by ED_undosys_stack_memfile_get_active().
|
static |
Definition at line 69 of file memfile_undo.c.
References C, ED_undo_is_memfile_compatible(), ED_undo_stack_get(), NULL, UndoStack::step_active, and USER_GLOBALUNDO.
Referenced by ED_memfile_undosys_type().
|
static |
Definition at line 145 of file memfile_undo.c.
References BKE_library_foreach_ID_link(), BKE_memfile_undo_decode(), BKE_scene_undo_depsgraphs_extract(), BKE_scene_undo_depsgraphs_restore(), BKE_UNDOSYS_TYPE_IS_MEMFILE_SKIP, BLI_assert, C, CTX_data_main(), CTX_data_scene(), MemFileUndoStep::data, DEG_id_tag_update_ex(), ED_editors_exit(), ED_editors_init_for_undo(), FOREACH_MAIN_ID_BEGIN, FOREACH_MAIN_ID_END, GS, id, Collection::id, bNodeTree::id, ID_SCE, IDWALK_READONLY, LIB_TAG_UNDO_OLD_ID_REUSED, Scene::master_collection, memfile_undosys_step_id_reused_cb(), ID::name, NC_SCENE, ND_LAYER_CONTENT, UndoStep::next, ntreeFromID(), NULL, UndoStep::prev, ID::recalc, ID::recalc_after_undo_push, scene, STEP_INVALID, STEP_REDO, STEP_UNDO, ID::tag, UndoStep::use_old_bmain_data, USER_EXPERIMENTAL_TEST, USER_GLOBALUNDO, and WM_event_add_notifier().
Referenced by ED_memfile_undosys_type().
|
static |
Definition at line 85 of file memfile_undo.c.
References BKE_memfile_undo_encode(), BKE_undosys_step_find_by_type(), BKE_UNDOSYS_TYPE_MEMFILE, MemFileUndoStep::data, UndoStep::data_size, ED_editors_flush_edits_ex(), ED_undo_stack_get(), Main::is_memfile_undo_flush_needed, NULL, MemFileUndoStep::step, MemFileUndoData::undo_size, Main::use_memfile_full_barrier, and UndoStep::use_old_bmain_data.
Referenced by ED_memfile_undosys_type().
|
static |
Definition at line 258 of file memfile_undo.c.
References BKE_memfile_undo_free(), BKE_undosys_step_same_type_next(), BLO_memfile_merge(), MemFileUndoStep::data, MemFileUndoData::memfile, UndoStep::next, and NULL.
Referenced by ED_memfile_undosys_type().
|
static |
Definition at line 112 of file memfile_undo.c.
References BLI_assert, Object::data, bPose::flag, GS, id, ID_AR, ID_OB, LibraryIDLinkCallbackData::id_pointer, LibraryIDLinkCallbackData::id_self, IDWALK_RET_NOP, IDWALK_RET_STOP_ITER, ID::lib, LIB_TAG_UNDO_OLD_ID_REUSED, ID::name, NULL, OB_ARMATURE, Object::pose, POSE_RECALC, ID::tag, and Object::type.
Referenced by memfile_undosys_step_decode().