[Bf-blender-cvs] [741e8cc118e] master: Fix (unreported) annoying UI assert for expanded enums.

Bastien Montagne noreply at git.blender.org
Sat May 11 15:45:57 CEST 2019


Commit: 741e8cc118e6468dc9f68f6472054921fea6dd8b
Author: Bastien Montagne
Date:   Sat May 11 15:35:48 2019 +0200
Branches: master
https://developer.blender.org/rB741e8cc118e6468dc9f68f6472054921fea6dd8b

Fix (unreported) annoying UI assert for expanded enums.

All buttons will get their own block's `func` by default, this cannot be
considered an error, do not assert in that case either.

Fixes bunch of very annoying asserts e.g. when using FBX exporter...

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

M	source/blender/editors/interface/interface_layout.c

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

diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index 15e507483ad..37ef0948dee 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -764,7 +764,8 @@ static void ui_item_enum_expand_elem_exec(uiLayout *layout,
 
   if (RNA_property_flag(prop) & PROP_ENUM_FLAG) {
     /* If this is set, assert since we're clobbering someone elses callback. */
-    BLI_assert(but->func == NULL);
+    /* Buttons get their block's func by default, so we cannot assert in that case either. */
+    BLI_assert(ELEM(but->func, NULL, block->func));
     UI_but_func_set(but, ui_item_enum_expand_handle, but, POINTER_FROM_INT(value));
   }



More information about the Bf-blender-cvs mailing list