Fix T52280: The Image node in Compositing can't read Z buffer of openEXR in 2.79
authorLukas Stockner <lukas.stockner@freenet.de>
Tue, 8 Aug 2017 21:00:02 +0000 (23:00 +0200)
committerLukas Stockner <lukas.stockner@freenet.de>
Tue, 8 Aug 2017 22:29:23 +0000 (00:29 +0200)
As part of the fix for T51587, I removed the Depth output for non-Multilayer
images since it seemed weird that PNGs etc. that don't have a Z pass still get
a socket for it.
However, I forgot about non-multilayer EXRs, which are a special case that can
actually have a Z pass.

Therefore, this commit brings back the Depth output for non-multilayer images
just like it was in 2.78.

source/blender/nodes/composite/nodes/node_composite_image.c

index 8139e29bade2c0a64d2c6fa86dd62361f7fd4b04..a95c3233132bcf1524f1aaee551ea8b5dafb6ed2 100644 (file)
@@ -178,6 +178,9 @@ static void cmp_node_image_create_outputs(bNodeTree *ntree, bNode *node, LinkNod
        cmp_node_image_add_pass_output(ntree, node, "Alpha", RE_PASSNAME_COMBINED, -1, SOCK_FLOAT, false, available_sockets, &prev_index);
 
        if (ima) {
+               if (!ima->rr) {
+                       cmp_node_image_add_pass_output(ntree, node, RE_PASSNAME_Z, RE_PASSNAME_Z, -1, SOCK_FLOAT, false, available_sockets, &prev_index);
+               }
                BKE_image_release_ibuf(ima, ibuf, NULL);
        }
 }