[Bf-blender-cvs] [475bd6b829c] blender-v2.83-release: Fix T76179: Unable to select render passes when a render has fewer passes than one in another slot

Philipp Oeser noreply at git.blender.org
Tue Apr 28 17:17:21 CEST 2020


Commit: 475bd6b829c38966b0fd4fdaff2eb61cc71c46c4
Author: Philipp Oeser
Date:   Tue Apr 28 12:59:23 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rB475bd6b829c38966b0fd4fdaff2eb61cc71c46c4

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

===================================================================

M	source/blender/editors/space_image/image_buttons.c

===================================================================

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,



More information about the Bf-blender-cvs mailing list