diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2015-04-23 14:21:36 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2015-04-23 14:21:36 +0300 |
commit | 85e455b2458f68c1d2c75fed7b5963fce4a70027 (patch) | |
tree | 42b837ae2528edf4de5fbd58cb124c6b17363a30 /source | |
parent | 8010672bbc1a89e2b7c30bc22e936052325e4b75 (diff) |
Fix slot menu not displayed if render result slot is empty
Caused by own mistake in 31f984bc3ffcc83834, reported by @sebastian_k in
IRC
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_image/image_buttons.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c index 2fb0a7e7c57..09ee5a26634 100644 --- a/source/blender/editors/space_image/image_buttons.c +++ b/source/blender/editors/space_image/image_buttons.c @@ -1216,14 +1216,16 @@ void uiTemplateImageLayers(uiLayout *layout, bContext *C, Image *ima, ImageUser RenderResult *rr; const float dpi_fac = UI_DPI_FAC; const int menus_width = 160 * dpi_fac; + const bool is_render_result = (ima->type == IMA_TYPE_R_RESULT); /* use BKE_image_acquire_renderresult so we get the correct slot in the menu */ rr = BKE_image_acquire_renderresult(scene, ima); - if (ima->type == IMA_TYPE_R_RESULT) { + if (rr && is_render_result) { uiblock_layer_pass_arrow_buttons(layout, ima, rr, iuser, menus_width, &ima->render_slot); } else { - uiblock_layer_pass_buttons(layout, ima, rr, iuser, menus_width, NULL); + uiblock_layer_pass_buttons(layout, ima, rr, iuser, menus_width, + is_render_result ? &ima->render_slot : NULL); } BKE_image_release_renderresult(scene, ima); } |