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:
authorTon Roosendaal <ton@blender.org>2004-09-18 16:12:45 +0400
committerTon Roosendaal <ton@blender.org>2004-09-18 16:12:45 +0400
commit562d6958cbf646aba31ed92fe4f0e07d1dc495b6 (patch)
tree31de7ac4e7df2e56d269b14e336a04a2e1316f82 /source/blender/src/usiblender.c
parent3d8a485fb9bef36f717423955c587ebc7834c784 (diff)
Another step in the undo evolution.
- Made unified API for undo calls, to be found in space.c BIF_undo_push(char *str) BIF_undo(void) BIF_redo(void) These calls will do all undo levels, including editmode and vpaint. The transition is work in progress, because mesh undo needs recode. - New global hotkey CTR+Z for undo Note: 'shaded draw mode' still is SHIFT+Z, the old CTRL+Z was to recalc the lighting in shaded mode, which already became much more interactive, like during/after any transform(). Recalc hotkey now is SHIFT+ALT+Z CTRL+<any modifier>+Z is redo. - For OSX users; the Apple-key ("Command") now maps to CTRL as well. This disables the one-mouse-button hack for rightmouse btw, will be fixed in next commit. At least we can use Apple-Z :) - Old Ukey for undo is still there, as a training period... my preference is to restore Ukey to "reload original data" as in past, and only use new CTRL+Z for undo. - Added undo_push() for all of editobject.c and editview.c. Meaning we can start using/testing global undo in the 3d window. Please dont comment on missing parts for now, first I want someone to volunteer to tackle all of that. - Since the global undo has a full 'file' in memory, it can save extremely fast on exit to <temp dir>/quit.blend. That's default now when global undo is enabled. It prints "Saved session recovery to ..." in console then. - In file menu, a new option is added "Recover Last Session". Note that this reads the undo-save, which is without UI. - With such nice new features we then can also kill the disputed Cancel/Confirm menu on Q-KEY. - Added fix which initializes seam/normal theme color on saved themes. They showed black now.... (Note: that's in usiblender.c!)
Diffstat (limited to 'source/blender/src/usiblender.c')
-rw-r--r--source/blender/src/usiblender.c45
1 files changed, 33 insertions, 12 deletions
diff --git a/source/blender/src/usiblender.c b/source/blender/src/usiblender.c
index 50e599b1427..8b006ba2e38 100644
--- a/source/blender/src/usiblender.c
+++ b/source/blender/src/usiblender.c
@@ -122,11 +122,6 @@
#include "PIL_time.h"
-// temporal, will go to include file
-void BIF_reset_undo(void);
-void BIF_write_undo(char *);
-
-
/***/
void BIF_read_file(char *name)
@@ -150,8 +145,8 @@ void BIF_read_file(char *name)
winqueue_break= 1; /* leave queues everywhere */
- BIF_reset_undo();
- BIF_write_undo("original"); /* save current state */
+ BKE_reset_undo();
+ BKE_write_undo("original"); /* save current state */
}
int BIF_read_homefile(void)
@@ -213,7 +208,7 @@ int BIF_read_homefile(void)
}
if (U.savetime <= 0) {
U.savetime = 1;
- error("%s is buggy, please cosider removing it.\n",
+ error("%s is buggy, please consider removing it.\n",
tstr);
}
if (G.main->versionfile <= 191) {
@@ -231,11 +226,32 @@ int BIF_read_homefile(void)
U.vrmlflag= USER_VRML_LAYERS;
}
+ /* added seam, normal color */
+ if (G.main->versionfile <= 234) {
+ bTheme *btheme;
+
+ for(btheme= U.themes.first; btheme; btheme= btheme->next) {
+ /* check for alpha==0 is safe, then color was never set */
+ if(btheme->tv3d.edge_seam[3]==0) {
+ btheme->tv3d.edge_seam[0]= 230;
+ btheme->tv3d.edge_seam[1]= 150;
+ btheme->tv3d.edge_seam[2]= 50;
+ btheme->tv3d.edge_seam[3]= 255;
+ }
+ if(btheme->tv3d.normal[3]==0) {
+ btheme->tv3d.normal[0]= 0x22;
+ btheme->tv3d.normal[1]= 0xDD;
+ btheme->tv3d.normal[2]= 0xDD;
+ btheme->tv3d.normal[3]= 255;
+ }
+ }
+ }
+
space_set_commmandline_options();
if (U.undosteps==0) U.undosteps=32;
- BIF_reset_undo();
- BIF_write_undo("original"); /* save current state */
+ BKE_reset_undo();
+ BKE_write_undo("original"); /* save current state */
reset_autosave();
@@ -455,6 +471,7 @@ void BIF_write_autosave(void)
BLO_write_file(tstr, write_flags, &err);
}
+/* if global undo; remove tempsave, otherwise rename */
static void delete_autosave(void)
{
char tstr[FILE_MAXDIR+FILE_MAXFILE];
@@ -464,7 +481,9 @@ static void delete_autosave(void)
if (BLI_exists(tstr)) {
char str[FILE_MAXDIR+FILE_MAXFILE];
BLI_make_file_string("/", str, U.tempdir, "quit.blend");
- BLI_rename(tstr, str);
+
+ if(U.uiflag & USER_GLOBALUNDO) BLI_delete(tstr, 0, 0);
+ else BLI_rename(tstr, str);
}
}
@@ -586,7 +605,9 @@ void exit_usiblender(void)
if (G.undo_clear) G.undo_clear();
undo_clear_curve();
- BIF_reset_undo();
+
+ BKE_undo_save_quit(); // saves quit.blend if global undo is on
+ BKE_reset_undo();
BLI_freelistN(&U.themes);