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-03-02 04:14:23 +0300
committerCampbell Barton <ideasman42@gmail.com>2016-03-02 04:19:34 +0300
commitcd6442f7d4b56cb40102d86404fbaeae30dd2d32 (patch)
tree2389098a24ead55e4781fd69ae3c2887fb22a99a /source/blender/editors/space_image/image_ops.c
parent0658659f74ad134bddbc982f7e1de0ff9b8bda66 (diff)
Use render path as initial location when saving renders
Diffstat (limited to 'source/blender/editors/space_image/image_ops.c')
-rw-r--r--source/blender/editors/space_image/image_ops.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c
index eb74922a256..14e39da841c 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -1528,19 +1528,21 @@ static int save_image_options_init(SaveImageOptions *simopts, SpaceImage *sima,
/* check for empty path */
if (guess_path && simopts->filepath[0] == 0) {
- const bool is_prev_save = !STREQ(G.ima, "//");
+ const bool is_pref_save = !STREQ(G.ima, "//");
+ RenderResult *rr = BKE_image_acquire_renderresult(scene, ima);
if (save_as_render) {
- if (is_prev_save) {
- BLI_strncpy(simopts->filepath, G.ima, sizeof(simopts->filepath));
- }
- else {
- BLI_strncpy(simopts->filepath, "//untitled", sizeof(simopts->filepath));
- BLI_path_abs(simopts->filepath, G.main->name);
+ const int cfra = rr ? rr->framenr : scene->r.cfra;
+ BKE_image_path_from_imformat(
+ simopts->filepath, scene->r.pic, G.main->name, cfra,
+ &simopts->im_format, (scene->r.scemode & R_EXTENSION) != 0, true, NULL);
+
+ if (rr) {
+ BKE_image_release_renderresult(scene, ima);
}
}
else {
BLI_snprintf(simopts->filepath, sizeof(simopts->filepath), "//%s", ima->id.name + 2);
- BLI_path_abs(simopts->filepath, is_prev_save ? G.ima : G.main->name);
+ BLI_path_abs(simopts->filepath, is_pref_save ? G.ima : G.main->name);
}
}