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:
authorGaia Clary <gaia.clary@machinimatrix.org>2013-04-09 19:18:31 +0400
committerGaia Clary <gaia.clary@machinimatrix.org>2013-04-09 19:18:31 +0400
commit64d1714586a5ee6b7e0f8b4d8e66dc6abf355316 (patch)
tree7681c7aa8293d8a351781a9def97007f54abbbcb /source/blender/windowmanager/intern/wm_operators.c
parent6382f6bedd4996962e84edc645c73b31b8bcbbb2 (diff)
temporary fix for saving custom template files similar to startup .blend file
Diffstat (limited to 'source/blender/windowmanager/intern/wm_operators.c')
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 1fac48259c1..f8628578fd8 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -2376,6 +2376,7 @@ static int wm_save_as_mainfile_invoke(bContext *C, wmOperator *op, const wmEvent
}
/* function used for WM_OT_save_mainfile too */
+static int wm_save_mainfile_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event));
static int wm_save_as_mainfile_exec(bContext *C, wmOperator *op)
{
char path[FILE_MAX];
@@ -2386,7 +2387,13 @@ static int wm_save_as_mainfile_exec(bContext *C, wmOperator *op)
if (RNA_struct_property_is_set(op->ptr, "filepath"))
RNA_string_get(op->ptr, "filepath", path);
else {
- BLI_strncpy(path, G.main->name, FILE_MAX);
+ /* if file has no name, then treat like startup file */
+ if (G.main->name[0] == 0) {
+ G.save_over = false;
+ return wm_save_mainfile_invoke(C, op, (wmEvent *)NULL);
+ }
+ else
+ BLI_strncpy(path, G.main->name, FILE_MAX);
untitled(path);
}