[Bf-blender-cvs] [42f40657f14] master: Images: remove option to choose between BW/RGB/RGBA for multilayer EXR save

Brecht Van Lommel noreply at git.blender.org
Mon Oct 3 22:07:48 CEST 2022


Commit: 42f40657f143f4f8f0c473daf8d54bab6d7c303e
Author: Brecht Van Lommel
Date:   Mon Oct 3 19:59:33 2022 +0200
Branches: master
https://developer.blender.org/rB42f40657f143f4f8f0c473daf8d54bab6d7c303e

Images: remove option to choose between BW/RGB/RGBA for multilayer EXR save

This was not properly respected, and in general with multiple passes and layers
it's unclear what this should do exactly without breaking some render passes.
Better to keep this image format for raw unmodified render results.

===================================================================

M	source/blender/editors/screen/screendump.c
M	source/blender/editors/space_image/image_buttons.c
M	source/blender/render/intern/render_result.cc

===================================================================

diff --git a/source/blender/editors/screen/screendump.c b/source/blender/editors/screen/screendump.c
index 38a9d8ba7ab..d46397180c5 100644
--- a/source/blender/editors/screen/screendump.c
+++ b/source/blender/editors/screen/screendump.c
@@ -124,7 +124,8 @@ static int screenshot_exec(bContext *C, wmOperator *op)
         scd->dumprect = ibuf->rect;
       }
 
-      if (scd->im_format.planes == R_IMF_PLANES_BW) {
+      if ((scd->im_format.planes == R_IMF_PLANES_BW) &&
+          (scd->im_format.imtype != R_IMF_IMTYPE_MULTILAYER)) {
         /* bw screenshot? - users will notice if it fails! */
         IMB_color_to_bw(ibuf);
       }
diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c
index bc367a99d6b..98e555c7f77 100644
--- a/source/blender/editors/space_image/image_buttons.c
+++ b/source/blender/editors/space_image/image_buttons.c
@@ -974,8 +974,16 @@ void uiTemplateImageSettings(uiLayout *layout, PointerRNA *imfptr, bool color_ma
   uiLayoutSetPropDecorate(col, false);
 
   uiItemR(col, imfptr, "file_format", 0, NULL, ICON_NONE);
-  uiItemR(
-      uiLayoutRow(col, true), imfptr, "color_mode", UI_ITEM_R_EXPAND, IFACE_("Color"), ICON_NONE);
+
+  /* Multi-layer always saves raw unmodified channels. */
+  if (imf->imtype != R_IMF_IMTYPE_MULTILAYER) {
+    uiItemR(uiLayoutRow(col, true),
+            imfptr,
+            "color_mode",
+            UI_ITEM_R_EXPAND,
+            IFACE_("Color"),
+            ICON_NONE);
+  }
 
   /* only display depth setting if multiple depths can be used */
   if (ELEM(depth_ok,
diff --git a/source/blender/render/intern/render_result.cc b/source/blender/render/intern/render_result.cc
index 7c4b0713d7c..d8179c4c495 100644
--- a/source/blender/render/intern/render_result.cc
+++ b/source/blender/render/intern/render_result.cc
@@ -1055,7 +1055,7 @@ ImBuf *RE_render_result_rect_to_ibuf(RenderResult *rr,
 
   /* Color -> gray-scale. */
   /* editing directly would alter the render view */
-  if (imf->planes == R_IMF_PLANES_BW) {
+  if (imf->planes == R_IMF_PLANES_BW && imf->imtype != R_IMF_IMTYPE_MULTILAYER) {
     ImBuf *ibuf_bw = IMB_dupImBuf(ibuf);
     IMB_color_to_bw(ibuf_bw);
     IMB_freeImBuf(ibuf);



More information about the Bf-blender-cvs mailing list