Fix for wrong channel number in ImBuf when file node output format is something other...
authorLukas Toenne <lukas.toenne@googlemail.com>
Thu, 1 Mar 2012 08:47:32 +0000 (08:47 +0000)
committerLukas Toenne <lukas.toenne@googlemail.com>
Thu, 1 Mar 2012 08:47:32 +0000 (08:47 +0000)
source/blender/nodes/composite/nodes/node_composite_outputFile.c

index 90aa03997c167052ebf1bc33afd84f2639576d9c..50b49fcff6899fb67906987b25f0bdc2e1679586 100644 (file)
@@ -163,6 +163,12 @@ static void exec_output_file_singlelayer(RenderData *rd, bNode *node, bNodeStack
                        }
                        
                        ibuf = IMB_allocImBuf(cbuf->x, cbuf->y, format->planes, 0);
                        }
                        
                        ibuf = IMB_allocImBuf(cbuf->x, cbuf->y, format->planes, 0);
+                       /* XXX have to set this explicitly it seems */
+                       switch (format->planes) {
+                       case R_IMF_PLANES_BW:   ibuf->channels = 1;     break;
+                       case R_IMF_PLANES_RGB:  ibuf->channels = 3;     break;
+                       case R_IMF_PLANES_RGBA: ibuf->channels = 4;     break;
+                       }
                        ibuf->rect_float = cbuf->rect;
                        ibuf->dither = rd->dither_intensity;
                        
                        ibuf->rect_float = cbuf->rect;
                        ibuf->dither = rd->dither_intensity;