diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-02-07 03:28:49 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-02-07 03:28:49 +0300 |
commit | 2cc02cdd9bdb6185780054f4966f97c3628bee4d (patch) | |
tree | 538dd66033ad47888a92858c426070bbb7b1ca65 /source/blender | |
parent | 7f2b2929ffd045b1694af29d121029fd94649638 (diff) |
Fix #20922: image window draw z-buffer wasn't drawing the z-buffer
from the select render layer.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/image.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 6280fb27430..09b86234d33 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -1943,7 +1943,7 @@ static ImBuf *image_get_render_result(Image *ima, ImageUser *iuser, void **lock_ } else { RenderResult rres; - float *rectf; + float *rectf, *rectz; unsigned int *rect; float dither; int channels, layer, pass; @@ -1956,6 +1956,7 @@ static ImBuf *image_get_render_result(Image *ima, ImageUser *iuser, void **lock_ RE_AcquireResultImage(RE_GetRender(iuser->scene->id.name), &rres); rect= (unsigned int *)rres.rect32; rectf= rres.rectf; + rectz= rres.rectz; dither= iuser->scene->r.dither_intensity; /* get compo/seq result by default */ @@ -1963,18 +1964,24 @@ static ImBuf *image_get_render_result(Image *ima, ImageUser *iuser, void **lock_ else if(rr->layers.first) { RenderLayer *rl= BLI_findlink(&rr->layers, layer-(rr->rectf?1:0)); if(rl) { + RenderPass *rpass; + /* there's no combined pass, is in renderlayer itself */ if(pass==0) { rectf= rl->rectf; } else { - RenderPass *rpass= BLI_findlink(&rl->passes, pass-1); + rpass= BLI_findlink(&rl->passes, pass-1); if(rpass) { channels= rpass->channels; rectf= rpass->rect; dither= 0.0f; /* don't dither passes */ } } + + for(rpass= rl->passes.first; rpass; rpass= rpass->next) + if(rpass->passtype == SCE_PASS_Z) + rectz= rpass->rect; } } @@ -1997,7 +2004,7 @@ static ImBuf *image_get_render_result(Image *ima, ImageUser *iuser, void **lock_ ibuf->rect_float= rectf; ibuf->flags |= IB_rectfloat; ibuf->channels= channels; - ibuf->zbuf_float= rres.rectz; + ibuf->zbuf_float= rectz; ibuf->flags |= IB_zbuffloat; ibuf->dither= dither; |