diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2015-04-17 15:48:31 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2015-04-17 15:48:31 +0300 |
commit | 479b6696932d133078690063508d8447d6dc0a28 (patch) | |
tree | bb4880a909f46e303d05a5305eea401bd38fbe94 /source/blender/editors/space_image/image_ops.c | |
parent | 02fba106fad37647ab015c228248ac0ec13a964b (diff) |
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
Diffstat (limited to 'source/blender/editors/space_image/image_ops.c')
-rw-r--r-- | source/blender/editors/space_image/image_ops.c | 44 |
1 files changed, 2 insertions, 42 deletions
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index aa625210464..756f90fe560 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -1533,41 +1533,6 @@ static void save_image_options_to_op(SaveImageOptions *simopts, wmOperator *op) RNA_string_set(op->ptr, "filepath", simopts->filepath); } -/* returns the pass index for the view_id */ -static int get_multiview_pass_id(RenderResult *rr, ImageUser *iuser, const int view_id) -{ - RenderLayer *rl; - RenderPass *rpass; - int passtype; - short rl_index = 0, rp_index; - - if (rr == NULL || iuser == NULL) - return 0; - - if (BLI_listbase_count_ex(&rr->views, 2) < 2) - return iuser->pass; - - if (RE_HasFakeLayer(rr)) - rl_index ++; /* fake compo/sequencer layer */ - - rl = BLI_findlink(&rr->layers, rl_index); - if (!rl) return iuser->pass; - - rpass = BLI_findlink(&rl->passes, iuser->pass); - passtype = rpass->passtype; - - rp_index = 0; - for (rpass = rl->passes.first; rpass; rpass = rpass->next, rp_index++) { - if (rpass->passtype == passtype && - rpass->view_id == view_id) - { - return rp_index; - } - } - - return iuser->pass; -} - static void save_image_post(wmOperator *op, ImBuf *ibuf, Image *ima, int ok, int save_copy, const char *relbase, int relative, int do_newpath, const char *filepath) { if (ok) { @@ -1761,13 +1726,10 @@ static bool save_image_doit(bContext *C, SpaceImage *sima, wmOperator *op, SaveI iuser.view = i; iuser.flag &= ~IMA_SHOW_STEREO; - if (rr) { - iuser.pass = get_multiview_pass_id(rr, &sima->iuser, i); + if (rr) BKE_image_multilayer_index(rr, &iuser); - } - else { + else BKE_image_multiview_index(ima, &iuser); - } ibuf = BKE_image_acquire_ibuf(sima->image, &iuser, &lock); ibuf->planes = planes; @@ -1810,9 +1772,7 @@ static bool save_image_doit(bContext *C, SpaceImage *sima, wmOperator *op, SaveI if (rr) { int id = BLI_findstringindex(&rr->views, names[i], offsetof(RenderView, name)); - iuser.pass = get_multiview_pass_id(rr, &sima->iuser, id); iuser.view = id; - BKE_image_multilayer_index(rr, &iuser); } else { |