Blender Git Commit Log

Git Commits -> Revision 651b8fb

Revision 651b8fb by Campbell Barton (master)
March 31, 2018, 18:40 (GMT)
Undo: unified undo system w/ linear history

- Use a single undo history for all operations.
- UndoType's are registered and poll the context to check if they
should be used when performing an undo push.
- Mode switching is used to ensure the state is correct before
undo data is restored.
- Some undo types accumulate changes (image & text editing)
others store the state multiple times (with de-duplication).
This is supported by checking UndoStack.mode `ACCUMULATE` / `STORE`.
- Each undo step stores ID datablocks they use with utilities to help
manage restoring correct ID's.
Needed since global undo is now mixed with other modes undo.
- Currently performs each undo step when going up/down history
Previously this wasn't done, making history fail in some cases.
This can be optimized to skip some combinations of undo steps.

grease-pencil is an exception which has not been updated
since it integrates undo into the draw-session.

See D3113

Commit Details:

Full Hash: 651b8fb14eb6ee5cbfa98bffe80a966a0753b14e
Parent Commit: 91d0825
Lines Changed: +3037, -1913

6 Added Paths:

/source/blender/blenkernel/BKE_undo_system.h (+187, -0) (View)
/source/blender/blenkernel/intern/undo_system.c (+795, -0) (View)
/source/blender/editors/space_text/text_undo.c (+170, -0) (View)
/source/blender/editors/util/memfile_undo.c (+149, -0) (View)
/source/blender/editors/util/undo_system_types.c (+74, -0) (View)
/source/blender/windowmanager/WM_undo.h (+0, -0) (View)

2 Deleted Paths:

/source/blender/editors/sculpt_paint/paint_undo.c (+0, -410)
/source/blender/editors/util/editmode_undo.c (+0, -372)

58 Modified Paths:

/build_files/cmake/macros.cmake (+3, -0) (Diff)
/source/blender/blenkernel/BKE_blender_undo.h (+4, -13) (Diff)
/source/blender/blenkernel/BKE_main.h (+4, -2) (Diff)
/source/blender/blenkernel/BKE_pointcache.h (+2, -4) (Diff)
/source/blender/blenkernel/CMakeLists.txt (+2, -0) (Diff)
/source/blender/blenkernel/intern/blender_undo.c (+15, -288) (Diff)
/source/blender/blenkernel/intern/library.c (+3, -0) (Diff)
/source/blender/blenloader/BLO_readfile.h (+2, -0) (Diff)
/source/blender/blenloader/BLO_undofile.h (+13, -1) (Diff)
/source/blender/blenloader/intern/readfile.c (+2, -1) (Diff)
/source/blender/blenloader/intern/undofile.c (+78, -0) (Diff)
/source/blender/editors/armature/editarmature_undo.c (+99, -20) (Diff)
/source/blender/editors/curve/editcurve.c (+3, -0) (Diff)
/source/blender/editors/curve/editcurve_undo.c (+122, -38) (Diff)
/source/blender/editors/curve/editfont_undo.c (+103, -19) (Diff)
/source/blender/editors/include/ED_armature.h (+5, -3) (Diff)
/source/blender/editors/include/ED_curve.h (+5, -3) (Diff)
/source/blender/editors/include/ED_lattice.h (+3, -1) (Diff)
/source/blender/editors/include/ED_mball.h (+3, -1) (Diff)
/source/blender/editors/include/ED_mesh.h (+4, -2) (Diff)
/source/blender/editors/include/ED_object.h (+1, -0) (Diff)
/source/blender/editors/include/ED_paint.h (+13, -20) (Diff)
/source/blender/editors/include/ED_particle.h (+4, -7) (Diff)
/source/blender/editors/include/ED_sculpt.h (+6, -0) (Diff)
/source/blender/editors/include/ED_text.h (+4, -3) (Diff)
/source/blender/editors/include/ED_util.h (+8, -9) (Diff)
/source/blender/editors/lattice/editlattice_undo.c (+101, -19) (Diff)
/source/blender/editors/mesh/editmesh_undo.c (+180, -27) (Diff)
/source/blender/editors/metaball/editmball_undo.c (+92, -24) (Diff)
/source/blender/editors/object/object_edit.c (+1, -0) (Diff)
/source/blender/editors/object/object_modes.c (+40, -0) (Diff)
/source/blender/editors/physics/particle_edit.c (+4, -3) (Diff)
/source/blender/editors/physics/particle_edit_undo.c (+120, -146) (Diff)
/source/blender/editors/physics/particle_object.c (+2, -6) (Diff)
/source/blender/editors/physics/physics_intern.h (+0, -1) (Diff)
/source/blender/editors/render/render_internal.c (+4, -1) (Diff)
/source/blender/editors/sculpt_paint/CMakeLists.txt (+0, -1) (Diff)
/source/blender/editors/sculpt_paint/paint_curve.c (+15, -7) (Diff)
/source/blender/editors/sculpt_paint/paint_curve_undo.c (+101, -61) (Diff)
/source/blender/editors/sculpt_paint/paint_image.c (+12, -3) (Diff)
/source/blender/editors/sculpt_paint/paint_image_2d.c (+4, -2) (Diff)
/source/blender/editors/sculpt_paint/paint_image_proj.c (+3, -2) (Diff)
/source/blender/editors/sculpt_paint/paint_image_undo.c (+134, -27) (Diff)
/source/blender/editors/sculpt_paint/paint_intern.h (+6, -4) (Diff)
/source/blender/editors/sculpt_paint/sculpt_intern.h (+2, -0) (Diff)
/source/blender/editors/sculpt_paint/sculpt_undo.c (+141, -30) (Diff)
/source/blender/editors/space_image/image_ops.c (+3, -2) (Diff)
/source/blender/editors/space_text/CMakeLists.txt (+1, -0) (Diff)
/source/blender/editors/space_text/text_ops.c (+43, -27) (Diff)
/source/blender/editors/util/CMakeLists.txt (+2, -1) (Diff)
/source/blender/editors/util/ed_util.c (+14, -3) (Diff)
/source/blender/editors/util/undo.c (+64, -255) (Diff)
/source/blender/editors/util/util_intern.h (+6, -8) (Diff)
/source/blender/makesdna/DNA_windowmanager_types.h (+3, -1) (Diff)
/source/blender/windowmanager/intern/wm.c (+7, -1) (Diff)
/source/blender/windowmanager/intern/wm_files.c (+13, -8) (Diff)
/source/blender/windowmanager/intern/wm_init_exit.c (+8, -11) (Diff)
/source/creator/creator_signals.c (+25, -15) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021