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:
authorRobert Wenzlaff <rwenzlaff@soylent-green.com>2003-10-20 00:52:34 +0400
committerRobert Wenzlaff <rwenzlaff@soylent-green.com>2003-10-20 00:52:34 +0400
commitd5322a6352edf8c6f23af18024c5c9ebc83b0c6f (patch)
treea97ac40d165f8e8de1d52b99f1f3036a66e1fa54 /source/blender/blenkernel/BKE_global.h
parentde64d218a08548d5b33f412374f360585356a41c (diff)
Editmesh Undo:
User Info: Pressing UKey in mesh edit mode now undoes only last step. Undo can save upto 64 steps of undo info. This is configurable under User Prefs-> Edit Methods. The default is 32. High numbers of undo steps use a lot of memory, since each step stores a copy of the mesh. Shift-U redoes the last undone step (Undoes the undo.) Alt-U brings up a menu of possible steps that can be undone. Selecting an item on the list undoes that item plus all items before it on the list. The top selection "Undo All" is identical to the old Ukey. It undoes all editing since entering Editmode, even if all regular undo steps are used up. Undo info is only saved for one object at a time. You can leave and re- enter editmode for the same object, and all undo steps for that object are preserved. Undo info for an object is lost once a different object is edited. Coder Info: In order for undo to work, a checkpoint save has to be made. This is done with a call to undo_push_mesh("name of step"). This should be done after the last quick abort for a function (typ. the "if (G.obedit==0) return;", or similar). the undo_push_mesh() does alter some flags, so don't try to be too tricky and call undo_push_mesh() too late. The step name is what shows up in the undo_menu. The name "U" is reserved.
Diffstat (limited to 'source/blender/blenkernel/BKE_global.h')
-rw-r--r--source/blender/blenkernel/BKE_global.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/source/blender/blenkernel/BKE_global.h b/source/blender/blenkernel/BKE_global.h
index 2f75dd8be16..698982f5396 100644
--- a/source/blender/blenkernel/BKE_global.h
+++ b/source/blender/blenkernel/BKE_global.h
@@ -62,6 +62,17 @@ struct Object;
struct bSoundListener;
struct BMF_Font;
+#define UNDO_MAX 64
+#define UNDO_EDIT_MAX 64
+
+typedef struct UndoBufferEdit {
+
+ void *datablock;
+ char name[64];
+
+} UndoBufferEdit;
+
+
typedef struct Global {
/* active pointers */
@@ -143,7 +154,15 @@ typedef struct Global {
short special1, special2;
int flags;
-
+
+ /* editmode undo - written by intrr, ported by Det. Thorn */
+ struct UndoBufferEdit undo_edit[UNDO_EDIT_MAX+1];/* need one more for undoing first undo */
+ int undo_edit_level; /* index of last undo buffer created */
+ int undo_edit_highest; /* index of highest undo buffer in use */
+ void *undo_last_data; /* pointer to last datablock edited */
+ void (*undo_clear)(void); /* pointer to function to free the undo data */
+
+
} Global;
/* **************** GLOBAL ********************* */