diff options
Diffstat (limited to 'source/blender/editors/space_image/image_ops.c')
-rw-r--r-- | source/blender/editors/space_image/image_ops.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index c4d69d589bf..1c4a1d7e8c9 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -1737,7 +1737,7 @@ static int image_save_options_init(Main *bmain, if (ELEM(ima->type, IMA_TYPE_R_RESULT, IMA_TYPE_COMPOSITE)) { /* imtype */ - BKE_image_format_copy(&opts->im_format, &scene->r.im_format); + BKE_image_format_init_for_write(&opts->im_format, scene, NULL); is_depth_set = true; if (!BKE_image_is_multiview(ima)) { /* In case multiview is disabled, @@ -1759,8 +1759,12 @@ static int image_save_options_init(Main *bmain, /* use the multiview image settings as the default */ opts->im_format.stereo3d_format = *ima->stereo3d_format; opts->im_format.views_format = ima->views_format; + + BKE_image_format_color_management_copy_from_scene(&opts->im_format, scene); } + opts->im_format.color_management = R_IMF_COLOR_MANAGEMENT_FOLLOW_SCENE; + if (ima->source == IMA_SRC_TILED) { BLI_strncpy(opts->filepath, ima->filepath, sizeof(opts->filepath)); BLI_path_abs(opts->filepath, ID_BLEND_PATH_FROM_GLOBAL(&ima->id)); @@ -1810,9 +1814,6 @@ static int image_save_options_init(Main *bmain, STR_CONCAT(opts->filepath, len, ".<UDIM>"); } } - - /* color management */ - BKE_image_format_color_management_copy_from_scene(&opts->im_format, scene); } BKE_image_release_ibuf(ima, ibuf, lock); @@ -2002,15 +2003,21 @@ static void image_save_as_draw(bContext *UNUSED(C), wmOperator *op) ImageSaveData *isd = op->customdata; PointerRNA imf_ptr; const bool is_multiview = RNA_boolean_get(op->ptr, "show_multiview"); + const bool use_color_management = RNA_boolean_get(op->ptr, "save_as_render"); - /* image template */ - RNA_pointer_create(NULL, &RNA_ImageFormatSettings, &isd->im_format, &imf_ptr); - uiTemplateImageSettings(layout, &imf_ptr, false); + uiLayoutSetPropSep(layout, true); + uiLayoutSetPropDecorate(layout, false); /* main draw call */ uiDefAutoButsRNA( layout, op->ptr, image_save_as_draw_check_prop, NULL, NULL, UI_BUT_LABEL_ALIGN_NONE, false); + uiItemS(layout); + + /* image template */ + RNA_pointer_create(NULL, &RNA_ImageFormatSettings, &isd->im_format, &imf_ptr); + uiTemplateImageSettings(layout, &imf_ptr, use_color_management); + /* multiview template */ if (is_multiview) { uiTemplateImageFormatViews(layout, &imf_ptr, op->ptr); |