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>2016-02-10 05:57:54 +0300
committerCampbell Barton <ideasman42@gmail.com>2016-02-10 07:27:28 +0300
commit184a2ee5a4a79540656a545f65f7bdbe3803d1cd (patch)
tree7797b9307d0db101035b3ef7843bc28c644e5deb /source/blender/editors/screen/screendump.c
parent15f76ca0723b236fe9b27bfe22b4875b30f90c3c (diff)
Fix screenshot adding image extension after .blend
Diffstat (limited to 'source/blender/editors/screen/screendump.c')
-rw-r--r--source/blender/editors/screen/screendump.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/editors/screen/screendump.c b/source/blender/editors/screen/screendump.c
index a6270af779b..2dd7400bc37 100644
--- a/source/blender/editors/screen/screendump.c
+++ b/source/blender/editors/screen/screendump.c
@@ -229,7 +229,12 @@ static int screenshot_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(
return screenshot_exec(C, op);
/* extension is added by 'screenshot_check' after */
- RNA_string_set(op->ptr, "filepath", G.relbase_valid ? G.main->name : "//screen");
+ char filepath[FILE_MAX] = "//screen";
+ if (G.relbase_valid) {
+ BLI_strncpy(filepath, G.main->name, sizeof(filepath));
+ BLI_replace_extension(filepath, sizeof(filepath), ""); /* strip '.blend' */
+ }
+ RNA_string_set(op->ptr, "filepath", filepath);
WM_event_add_fileselect(C, op);