From 479b6696932d133078690063508d8447d6dc0a28 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Fri, 17 Apr 2015 09:48:31 -0300 Subject: Fix T44336: Unable to select cycles-specific passes in UV/image editor This approach gets rid of iuser->pass for good. Also, I'm commenting out the pass increase/decrease. This was broken since multiview. I will fix it later (before 2.75), but I didn't want to get this patch mangled with that fix. Thanks Sergey Sharybin for the review and feedbacks. Reviewers: sergey Differential Revision: https://developer.blender.org/D1232 --- source/blender/blenkernel/intern/image.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) (limited to 'source/blender/blenkernel') diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 80828533a31..bb9fdba94fa 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -2475,7 +2475,7 @@ static void image_init_imageuser(Image *ima, ImageUser *iuser) RenderResult *rr = ima->rr; iuser->multi_index = 0; - iuser->layer = iuser->pass = iuser->view = 0; + iuser->layer = iuser->view = 0; iuser->passtype = SCE_PASS_COMBINED; if (rr) { @@ -2649,15 +2649,14 @@ RenderPass *BKE_image_multilayer_index(RenderResult *rr, ImageUser *iuser) return NULL; if (iuser) { - short index = 0, rv_index, rl_index = 0, rp_index; + short index = 0, rv_index, rl_index = 0; bool is_stereo = (iuser->flag & IMA_SHOW_STEREO) && RE_RenderResult_is_stereo(rr); rv_index = is_stereo ? iuser->multiview_eye : iuser->view; + if (RE_HasFakeLayer(rr)) rl_index += 1; for (rl = rr->layers.first; rl; rl = rl->next, rl_index++) { - rp_index = 0; - - for (rpass = rl->passes.first; rpass; rpass = rpass->next, index++, rp_index++) { + for (rpass = rl->passes.first; rpass; rpass = rpass->next, index++) { if (iuser->layer == rl_index && iuser->passtype == rpass->passtype && rv_index == rpass->view_id) @@ -2668,20 +2667,16 @@ RenderPass *BKE_image_multilayer_index(RenderResult *rr, ImageUser *iuser) if (rpass) break; } - - if (rpass) { - iuser->multi_index = index; - iuser->pass = rp_index; - } - else { - iuser->multi_index = 0; - iuser->pass = 0; - } + iuser->multi_index = (rpass ? index : 0); } + if (rpass == NULL) { rl = rr->layers.first; if (rl) rpass = rl->passes.first; + + if (rpass && iuser) + iuser->passtype = rpass->passtype; } return rpass; -- cgit v1.2.3