The undo test is now safely hidden behind a user-button (temporal)
authorTon Roosendaal <ton@blender.org>
Tue, 31 Aug 2004 21:01:21 +0000 (21:01 +0000)
committerTon Roosendaal <ton@blender.org>
Tue, 31 Aug 2004 21:01:21 +0000 (21:01 +0000)
Activate it in User menu "edit methods"

source/blender/makesdna/DNA_userdef_types.h
source/blender/src/space.c
source/blender/src/usiblender.c

index c43aa6268cb3c34f9e848befbd9e4547a814d0bc..fef367b6e3fc7d1d6854b6e99fb95efcc7dc8a35 100644 (file)
@@ -192,7 +192,7 @@ extern UserDef U; /* from usiblender.c !!!! */
 #define USER_PANELPINNED               1024
 #define USER_AUTOPERSP                 2048
 #define USER_LOCKAROUND        4096
-
+#define USER_GLOBALUNDO        8192
 
 /* transopts */
 
index f99ed5032a9d7240469467802f61a2addbce8fc5..930f9a3eb37bd6ae6630a0817189b93cb89d2a69 100644 (file)
@@ -1438,12 +1438,13 @@ void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
                                                wpaint_undo();
                                        else if(G.f & G_VERTEXPAINT)
                                                vpaint_undo();
-                                       else
-                                               // single_user();
-                                               BIF_undo_step(1);
+                                       else {
+                                               if(U.uiflag & USER_GLOBALUNDO) BIF_undo_step(1);
+                                               else single_user();
+                                       }
                                }
                                else if(G.qual==LR_SHIFTKEY)
-                                       BIF_undo_step(-1);
+                                       if(U.uiflag & USER_GLOBALUNDO) BIF_undo_step(-1);
                                        
                                break;
                        case VKEY:
@@ -2314,13 +2315,17 @@ void drawinfospace(ScrArea *sa, void *spacedata)
                uiBlockEndAlign(block);
 
 
-               uiDefBut(block, LABEL,0,"Mesh undo:",
+               uiDefBut(block, LABEL,0,"Editmode undo:",
                        (xpos+(2*edgsp)+mpref),y3label, mpref,buth,
                        0, 0, 0, 0, 0, "");
                uiDefButS(block, NUMSLI, B_DRAWINFO, "Steps:",
                        (xpos+edgsp+mpref+midsp),y2,mpref,buth,
                        &(U.undosteps), 2, 64, 0, 0, "Number of undo steps available in Edit Mode (smaller values conserve memory)");
 
+               uiDefButBitS(block, TOG, USER_GLOBALUNDO, B_DRAWINFO, "Global undo",
+                       (xpos+edgsp+mpref+midsp),y1,mpref,buth,
+                       &(U.uiflag), 2, 64, 0, 0, "");
+
 
                uiDefBut(block, LABEL,0,"Auto keyframe on:",
                        (xpos+(2*edgsp)+(2*mpref)+midsp),y3label,mpref,buth,
index ff5b334e48003b3e55ee3b3e3e202e8f3e07cfbf..b484d2d7d689dbe4fa55a76a54db68aae29f4c47 100644 (file)
@@ -507,8 +507,9 @@ void BIF_write_undo(char *name)
        char *err, tstr[FILE_MAXDIR+FILE_MAXFILE];
        UndoElem *uel;
        
-       /* calculate current filename */
+       if( (U.uiflag & USER_GLOBALUNDO==0)) return;
        
+       /* calculate current filename */
        counter++;
        counter= counter % MAXUNDO;     
        get_undosave_location(tstr, counter);