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
This commit is contained in:
YimingWu
2025-07-25 08:26:31 +02:00
committed by YimingWu
parent 2927388682
commit 2def8c8b67

View File

@@ -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);
}