[Bf-blender-cvs] [19cdcea] master: Fix T46748: OpenEXR output different when frame saved with F3 vs. in an animation

Sergey Sharybin noreply at git.blender.org
Thu Nov 12 15:19:57 CET 2015


Commit: 19cdceaee415ddba7e3a197e1e2487ae09d766a8
Author: Sergey Sharybin
Date:   Thu Nov 12 19:17:25 2015 +0500
Branches: master
https://developer.blender.org/rB19cdceaee415ddba7e3a197e1e2487ae09d766a8

Fix T46748: OpenEXR output different when frame saved with F3 vs. in an animation

The issue was caused by the image save operator ignoring Z-Buf if the input
buffer due to the way how IMB_dupImBuf() worked. There's no reason to to
ignore z-buf on imbuf duplication, it only asks for issues in the future.

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

M	source/blender/imbuf/intern/allocimbuf.c

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

diff --git a/source/blender/imbuf/intern/allocimbuf.c b/source/blender/imbuf/intern/allocimbuf.c
index 19b68b1..a9a21b4 100644
--- a/source/blender/imbuf/intern/allocimbuf.c
+++ b/source/blender/imbuf/intern/allocimbuf.c
@@ -502,6 +502,8 @@ ImBuf *IMB_dupImBuf(ImBuf *ibuf1)
 
 	if (ibuf1->rect) flags |= IB_rect;
 	if (ibuf1->rect_float) flags |= IB_rectfloat;
+	if (ibuf1->zbuf) flags |= IB_zbuf;
+	if (ibuf1->zbuf_float) flags |= IB_zbuffloat;
 
 	x = ibuf1->x;
 	y = ibuf1->y;
@@ -516,6 +518,12 @@ ImBuf *IMB_dupImBuf(ImBuf *ibuf1)
 	if (flags & IB_rectfloat)
 		memcpy(ibuf2->rect_float, ibuf1->rect_float, ((size_t)ibuf1->channels) * x * y * sizeof(float));
 
+	if (flags & IB_zbuf)
+		memcpy(ibuf2->zbuf, ibuf1->zbuf, ((size_t)x) * y * sizeof(int));
+
+	if (flags & IB_rectfloat)
+		memcpy(ibuf2->zbuf_float, ibuf1->zbuf_float, ((size_t)x) * y * sizeof(float));
+
 	if (ibuf1->encodedbuffer) {
 		ibuf2->encodedbuffersize = ibuf1->encodedbuffersize;
 		if (imb_addencodedbufferImBuf(ibuf2) == false) {
@@ -533,8 +541,8 @@ ImBuf *IMB_dupImBuf(ImBuf *ibuf1)
 	tbuf.rect          = ibuf2->rect;
 	tbuf.rect_float    = ibuf2->rect_float;
 	tbuf.encodedbuffer = ibuf2->encodedbuffer;
-	tbuf.zbuf          = NULL;
-	tbuf.zbuf_float    = NULL;
+	tbuf.zbuf          = ibuf2->zbuf;
+	tbuf.zbuf_float    = ibuf2->zbuf_float;
 	for (a = 0; a < IMB_MIPMAP_LEVELS; a++)
 		tbuf.mipmap[a] = NULL;
 	tbuf.dds_data.data = NULL;




More information about the Bf-blender-cvs mailing list