diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-05-30 15:23:45 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-05-30 17:24:12 +0300 |
commit | fc1ae52994016fc4d43053caa412212726f7e223 (patch) | |
tree | 7fa498e890ab0ecaa2ce96e925c68209981ea3e8 /source/blender/blenkernel/intern | |
parent | 65bd9974d1a6e3b66b9613a60e521a5211631304 (diff) |
Fix T98444: Image.save_render not using scene output file type
Also simplify logic because (source == IMA_SRC_VIEWER) and
ELEM(type, IMA_TYPE_R_RESULT, IMA_TYPE_COMPOSITE) are the same
thing.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/image_save.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/image_save.cc b/source/blender/blenkernel/intern/image_save.cc index b67d3490e03..910ac15d1c5 100644 --- a/source/blender/blenkernel/intern/image_save.cc +++ b/source/blender/blenkernel/intern/image_save.cc @@ -78,7 +78,8 @@ bool BKE_image_save_options_init(ImageSaveOptions *opts, Scene *scene, Image *ima, ImageUser *iuser, - const bool guess_path) + const bool guess_path, + const bool save_as_render) { /* For saving a tiled image we need an iuser, so use a local one if there isn't already one. */ ImageUser save_iuser; @@ -92,7 +93,7 @@ bool BKE_image_save_options_init(ImageSaveOptions *opts, opts->bmain = bmain; opts->scene = scene; - opts->save_as_render = ima->source == IMA_SRC_VIEWER; + opts->save_as_render = ima->source == IMA_SRC_VIEWER || save_as_render; BKE_image_format_init(&opts->im_format, false); @@ -104,8 +105,8 @@ bool BKE_image_save_options_init(ImageSaveOptions *opts, bool is_depth_set = false; const char *ima_colorspace = ima->colorspace_settings.name; - if (ELEM(ima->type, IMA_TYPE_R_RESULT, IMA_TYPE_COMPOSITE)) { - /* imtype */ + if (opts->save_as_render) { + /* Render/compositor output or user chose to save with render settings. */ BKE_image_format_init_for_write(&opts->im_format, scene, NULL); is_depth_set = true; if (!BKE_image_is_multiview(ima)) { |