Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-02-04 07:01:55 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-02-04 07:01:55 +0300
commit55c29e36dccddc7ae8c6512b6dec074437214097 (patch)
tree0d439554dea0e226c01f8b2969f33f6b32b656c1 /source/blender/blenkernel/intern/undo_system.c
parentb5c841498c468771219b89c6b58bc751ee4e2472 (diff)
Undo System: add function to print undo steps
Useful for debugging.
Diffstat (limited to 'source/blender/blenkernel/intern/undo_system.c')
-rw-r--r--source/blender/blenkernel/intern/undo_system.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/undo_system.c b/source/blender/blenkernel/intern/undo_system.c
index 0969a3299b9..f56dd953283 100644
--- a/source/blender/blenkernel/intern/undo_system.c
+++ b/source/blender/blenkernel/intern/undo_system.c
@@ -1002,3 +1002,27 @@ ID *BKE_undosys_ID_map_lookup_with_prev(const UndoIDPtrMap *map, ID *id_src, ID
}
/** \} */
+
+
+/* -------------------------------------------------------------------- */
+/** \name Debug Helpers
+ * \{ */
+
+void BKE_undosys_print(UndoStack *ustack)
+{
+ printf("Undo %d Steps (A: active, M=memfile-active, S=skip)\n",
+ BLI_listbase_count(&ustack->steps));
+ int index = 0;
+ for (UndoStep *us = ustack->steps.first; us; us = us->next) {
+ printf("[%c%c%c] %3d type='%s', name='%s'\n",
+ (us == ustack->step_active) ? 'A' : '_',
+ (us == ustack->step_active_memfile) ? 'M' : '_',
+ us->skip ? 'S' : '_',
+ index,
+ us->type->name,
+ us->name);
+ index++;
+ }
+}
+
+/** \} */