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>2010-06-22 12:38:12 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-06-22 12:38:12 +0400
commiteeed68a20fa1a00af86db1d1b342506b249edcf6 (patch)
treee3e01bc3304b2ca17a6f15aa1bd739af66704c81 /source/blender/windowmanager
parenta25357bbbc625a8435655d22188c65f18cc788a2 (diff)
utility function to save blend's from a crash (from gdb run this)
p write_crash_blend() Which will save the current blend name with _crash prefix.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/intern/wm_files.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index 17a04cab7be..93fe5e58a43 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -533,6 +533,22 @@ static ImBuf *blend_file_thumb(const char *path, Scene *scene, int **thumb_pt)
return ibuf;
}
+/* easy access from gdb */
+int write_crash_blend(void)
+{
+ char path[FILE_MAX];
+ BLI_strncpy(path, G.sce, sizeof(path));
+ BLI_replace_extension(path, sizeof(path), "_crash.blend");
+ if(BLO_write_file(G.main, G.sce, G.fileflags, NULL, NULL)) {
+ printf("written: %s\n", path);
+ return 1;
+ }
+ else {
+ printf("failed: %s\n", path);
+ return 0;
+ }
+}
+
int WM_write_file(bContext *C, char *target, int fileflags, ReportList *reports)
{
Library *li;