diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-03-02 04:14:23 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-03-02 04:19:34 +0300 |
commit | cd6442f7d4b56cb40102d86404fbaeae30dd2d32 (patch) | |
tree | 2389098a24ead55e4781fd69ae3c2887fb22a99a /source | |
parent | 0658659f74ad134bddbc982f7e1de0ff9b8bda66 (diff) |
Use render path as initial location when saving renders
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_image/image_ops.c | 18 | ||||
-rw-r--r-- | source/blender/render/intern/source/render_result.c | 1 |
2 files changed, 11 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); } } diff --git a/source/blender/render/intern/source/render_result.c b/source/blender/render/intern/source/render_result.c index c89adc4a814..9ee76ba00cb 100644 --- a/source/blender/render/intern/source/render_result.c +++ b/source/blender/render/intern/source/render_result.c @@ -596,6 +596,7 @@ RenderResult *render_result_new(Render *re, rcti *partrct, int crop, int savebuf rr->renrect.xmin = 0; rr->renrect.xmax = rectx - 2 * crop; /* crop is one or two extra pixels rendered for filtering, is used for merging and display too */ rr->crop = crop; + rr->framenr = re->r.cfra; /* tilerect is relative coordinates within render disprect. do not subtract crop yet */ rr->tilerect.xmin = partrct->xmin - re->disprect.xmin; |