|
Blender V4.3
|
#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.hh"#include "BKE_context.hh"#include "BKE_lib_query.hh"#include "BKE_main.hh"#include "BKE_node.hh"#include "BKE_preview_image.hh"#include "BKE_scene.hh"#include "BKE_undo_system.hh"#include "../depsgraph/DEG_depsgraph.hh"#include "WM_api.hh"#include "WM_types.hh"#include "ED_render.hh"#include "ED_undo.hh"#include "ED_util.hh"#include "../blenloader/BLO_undofile.hh"#include "undo_intern.hh"#include <cstdio>Go to the source code of this file.
Classes | |
| struct | MemFileUndoStep |
Functions | |
Implements ED Undo System | |
| static bool | memfile_undosys_poll (bContext *C) |
| static bool | memfile_undosys_step_encode (bContext *, Main *bmain, UndoStep *us_p) |
| static int | memfile_undosys_step_id_reused_cb (LibraryIDLinkCallbackData *cb_data) |
| static void | memfile_undosys_unfinished_id_previews_restart (ID *id) |
| static void | memfile_undosys_step_decode (bContext *C, Main *bmain, UndoStep *us_p, const eUndoStepDir undo_direction, bool) |
| static void | memfile_undosys_step_free (UndoStep *us_p) |
| void | ED_memfile_undosys_type (UndoType *ut) |
Utilities | |
| static MemFile * | ed_undosys_step_get_memfile (UndoStep *us_p) |
| MemFile * | ED_undosys_stack_memfile_get_if_active (UndoStack *ustack) |
| void | ED_undosys_stack_memfile_id_changed_tag (UndoStack *ustack, ID *id) |
Wrapper between 'ED_undo.hh' and 'BKE_undo_system.hh' API's.
Definition in file memfile_undo.cc.
| void ED_memfile_undosys_type | ( | UndoType * | ut | ) |
Export for ED_undo_sys.
Definition at line 328 of file memfile_undo.cc.
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 357 of file memfile_undo.cc.
References BKE_UNDOSYS_TYPE_MEMFILE, ed_undosys_step_get_memfile(), UndoStack::step_active, and UndoStep::type.
Referenced by wm_autosave_write_try().
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 368 of file memfile_undo.cc.
References BKE_UNDOSYS_TYPE_MEMFILE, MemFile::chunks, LISTBASE_FOREACH, UndoStack::step_active, and UndoStep::type.
Referenced by blender::ed::sculpt_paint::undo::push_begin_ex().
Ideally we wouldn't need to export global undo internals, there are some cases where it's needed though.
Definition at line 351 of file memfile_undo.cc.
References MemFileUndoStep::data, and MemFileUndoData::memfile.
Referenced by ED_undosys_stack_memfile_get_if_active().
|
static |
Definition at line 57 of file memfile_undo.cc.
References ED_undo_is_memfile_compatible(), ED_undo_stack_get(), UndoStack::step_active, and USER_GLOBALUNDO.
Referenced by ED_memfile_undosys_type().
|
static |
Definition at line 157 of file memfile_undo.cc.
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, CTX_data_main(), CTX_data_scene(), CTX_wm_manager(), MemFileUndoStep::data, DEG_id_tag_update_ex(), ED_editors_exit(), ED_editors_init_for_undo(), ED_preview_kill_jobs(), FOREACH_MAIN_ID_BEGIN, FOREACH_MAIN_ID_END, GS, bNodeTree::id, Collection::id, ID_RECALC_SYNC_TO_EVAL, ID_SCE, ID_TAG_UNDO_OLD_ID_REREAD_IN_PLACE, ID_TAG_UNDO_OLD_ID_REUSED_NOUNDO, ID_TAG_UNDO_OLD_ID_REUSED_UNCHANGED, IDWALK_READONLY, Scene::master_collection, memfile_undosys_step_id_reused_cb(), memfile_undosys_unfinished_id_previews_restart(), NC_SCENE, ND_LAYER_CONTENT, UndoStep::next, blender::bke::node_tree_from_id(), UndoStep::prev, ID::recalc, ID::recalc_after_undo_push, STEP_INVALID, STEP_REDO, STEP_UNDO, UndoStep::use_old_bmain_data, USER_EXPERIMENTAL_TEST, USER_GLOBALUNDO, and WM_event_add_notifier().
Referenced by ED_memfile_undosys_type().
Definition at line 73 of file memfile_undo.cc.
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, 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 312 of file memfile_undo.cc.
References BKE_memfile_undo_free(), BKE_undosys_step_same_type_next(), BLO_memfile_merge(), MemFileUndoStep::data, MemFileUndoData::memfile, and UndoStep::next.
Referenced by ED_memfile_undosys_type().
|
static |
Definition at line 98 of file memfile_undo.cc.
References BLI_assert, Object::data, bPose::flag, GS, ID_AR, ID_IS_LINKED, ID_OB, LibraryIDLinkCallbackData::id_pointer, ID_TAG_UNDO_OLD_ID_REUSED_UNCHANGED, IDWALK_RET_NOP, IDWALK_RET_STOP_ITER, ID::name, OB_ARMATURE, Object::pose, POSE_RECALC, LibraryIDLinkCallbackData::self_id, ID::tag, and Object::type.
Referenced by memfile_undosys_step_decode().
|
static |
ID previews may be generated in a parallel job. So whatever operation generates the preview likely does the undo push before the preview is actually done and stored in the ID. Hence they get some extra treatment here: When undoing back to the moment the preview generation was triggered, this function schedules the preview for regeneration.
Definition at line 138 of file memfile_undo.cc.
References BKE_previewimg_id_get(), BKE_previewimg_is_finished(), ED_preview_restart_queue_add(), PreviewImage::flag, NUM_ICON_SIZES, and PRV_USER_EDITED.
Referenced by memfile_undosys_step_decode().