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.
This commit is contained in:
2003-10-19 20:52:34 +00:00
parent de64d218a0
commit d5322a6352
9 changed files with 329 additions and 30 deletions

View File

@@ -1168,7 +1168,11 @@ void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
break;
case UKEY:
if(G.obedit) {
if(G.obedit->type==OB_MESH) remake_editMesh();
if(G.obedit->type==OB_MESH){
if (G.qual & LR_ALTKEY) undo_menu_mesh();
else if (G.qual & LR_SHIFTKEY) undo_redo_mesh();
else undo_pop_mesh(1);
}
else if(G.obedit->type==OB_ARMATURE) remake_editArmature();
else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) remake_editNurb();
else if(G.obedit->type==OB_LATTICE) remake_editLatt();
@@ -1881,7 +1885,9 @@ void drawinfospace(ScrArea *sa, void *spacedata)
uiBlockSetCol(block, BUTGREY);
uiDefButS(block, NUMSLI, B_DRAWINFO, "UndoSteps:",
(xpos+edgespace+2*smallprefbut+8),y2,(medprefbut+2),buth,
&(U.undosteps), 1, 64, 0, 0, "Number of undo steps avail. in Editmode. Smaller conserves memory.");
uiDefBut(block, LABEL,0,"Auto keyframe on:",
(xpos+edgespace+(2*medprefbut)+midspace),y3label,medprefbut,buth,
@@ -1935,8 +1941,7 @@ void drawinfospace(ScrArea *sa, void *spacedata)
uiDefButS(block, TOG|BIT|6, 0, "Ipo",
(xpos+edgespace+(8*midspace)+(3*medprefbut)+(5*smallprefbut)),y1,smallprefbut,buth,
&(U.dupflag), 0, 0, 0, 0, "Causes ipo data to be duplicated with Shift+D");
} else if(U.userpref == 2) { /* language & colors */
#ifdef INTERNATIONAL