From 475bd6b829c38966b0fd4fdaff2eb61cc71c46c4 Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Tue, 28 Apr 2020 12:59:23 +0200 Subject: Fix T76179: Unable to select render passes when a render has fewer passes than one in another slot If a particular pass is not available in a slot we are switching to, still show the menu, but with a blank name for the currently selected item so that the user can change it to a valid value. thx @brecht for providing the standard way Blender deals with these kinds of situations. Maniphest Tasks: T76179 Differential Revision: https://developer.blender.org/D7552 --- source/blender/editors/space_image/image_buttons.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/space_image') diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c index 3658ebae3a2..fcd6baa9582 100644 --- a/source/blender/editors/space_image/image_buttons.c +++ b/source/blender/editors/space_image/image_buttons.c @@ -656,8 +656,8 @@ static void uiblock_layer_pass_buttons( /* pass */ rpass = (rl ? BLI_findlink(&rl->passes, iuser->pass) : NULL); - if (rpass && RE_passes_have_name(rl)) { - display_name = rpass->name; + if (RE_passes_have_name(rl)) { + display_name = rpass ? rpass->name : ""; rnd_pt = ui_imageuser_data_copy(&rnd_pt_local); but = uiDefMenuBut(block, ui_imageuser_pass_menu, -- cgit v1.2.3