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>2007-10-24 01:31:59 +0400
committerCampbell Barton <ideasman42@gmail.com>2007-10-24 01:31:59 +0400
commit5b0a79c7c76d2ddc62ffeec48ccfaf22c5f2bf65 (patch)
treeec6cb6a7d421542f262d0333d410a8d9d8635f2a /source/blender/src/usiblender.c
parent7fc1297b3cd2b99667558cdb8b93f300a0d56b69 (diff)
bug fix, when opening blender with a file (by double clicking or from the command line) - the initial undo state would be set to the default scene.
So holding Ctrl+Z would go back to the default .B.blend rather then the file that the user opened.
Diffstat (limited to 'source/blender/src/usiblender.c')
-rw-r--r--source/blender/src/usiblender.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/source/blender/src/usiblender.c b/source/blender/src/usiblender.c
index 8b6cd987cf8..3928f736f1a 100644
--- a/source/blender/src/usiblender.c
+++ b/source/blender/src/usiblender.c
@@ -483,7 +483,7 @@ static void outliner_242_patch(void)
}
/* only here settings for fullscreen */
-int BIF_read_homefile(int from_memory)
+int BIF_read_homefile(int from_memory, int do_undo)
{
char tstr[FILE_MAXDIR+FILE_MAXFILE], scestr[FILE_MAXDIR];
char *home= BLI_gethome();
@@ -526,7 +526,9 @@ int BIF_read_homefile(int from_memory)
undo_editmode_clear();
BKE_reset_undo();
- BKE_write_undo("original"); /* save current state */
+
+ if (do_undo)
+ BIF_undo_push("original");
return success;
}
@@ -896,7 +898,11 @@ void BIF_init(void)
init_node_butfuncs();
BIF_preview_init_dbase();
- BIF_read_homefile(0);
+
+ /* dont set an undo here because this sets the default scene to be the initial
+ undo state when loading blender with a file a new file, so holding Ctrl+Z will undo to the default
+ scene rather then to the new file */
+ BIF_read_homefile(0, 0);
BIF_resources_init(); /* after homefile, to dynamically load an icon file based on theme settings */