From 2def8c8b671f228db199dcbaa3ae90a186523a88 Mon Sep 17 00:00:00 2001 From: YimingWu Date: Fri, 25 Jul 2025 08:26:31 +0200 Subject: [PATCH] Fix #120885: Ensure EXR view_format selection in stereo When stereoscopy is enabled, OpenEXR and OpenEXR Multilayer supports different stereoscopy view format, ensure the view format selection when selecting the output file format, so the value is always valid when saving the image. Pull Request: https://projects.blender.org/blender/blender/pulls/120904 --- source/blender/blenkernel/intern/image_format.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/source/blender/blenkernel/intern/image_format.cc b/source/blender/blenkernel/intern/image_format.cc index 7718a27d554..e640d7c8076 100644 --- a/source/blender/blenkernel/intern/image_format.cc +++ b/source/blender/blenkernel/intern/image_format.cc @@ -121,6 +121,18 @@ void BKE_image_format_set(ImageFormatData *imf, ID *owner_id, const char imtype) MOV_validate_output_settings(rd, imf); } + /* Verify `imf->views_format`. */ + if (imf->imtype == R_IMF_IMTYPE_MULTILAYER) { + if (imf->views_format == R_IMF_VIEWS_STEREO_3D) { + imf->views_format = R_IMF_VIEWS_MULTIVIEW; + } + } + else if (imf->imtype != R_IMF_IMTYPE_OPENEXR) { + if (imf->views_format == R_IMF_VIEWS_MULTIVIEW) { + imf->views_format = R_IMF_VIEWS_INDIVIDUAL; + } + } + BKE_image_format_update_color_space_for_type(imf); }