From 6fdaa9c99a4660312e8e06051686fc30b9cc4c06 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Mon, 28 Jan 2013 18:46:04 +0000 Subject: [PATCH] Fix [#34023] r54146 breaks name-display of default "UI_UL_list" draw_item *is* optional (it then uses default C function), even though there is not much sense to register a class without it, except for our default UI_UL_list! --- release/scripts/startup/bl_ui/__init__.py | 3 +-- source/blender/makesrna/intern/rna_ui.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/release/scripts/startup/bl_ui/__init__.py b/release/scripts/startup/bl_ui/__init__.py index 3bb19a4964d..982c723f08e 100644 --- a/release/scripts/startup/bl_ui/__init__.py +++ b/release/scripts/startup/bl_ui/__init__.py @@ -138,7 +138,6 @@ def unregister(): # Define a default UIList, when a list does not need any custom drawing... class UI_UL_list(bpy.types.UIList): - def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index): - pass + pass bpy.utils.register_class(UI_UL_list) diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c index f3921b2412a..e5585b4f72d 100644 --- a/source/blender/makesrna/intern/rna_ui.c +++ b/source/blender/makesrna/intern/rna_ui.c @@ -863,7 +863,7 @@ static void rna_def_uilist(BlenderRNA *brna) func = RNA_def_function(srna, "draw_item", NULL); RNA_def_function_ui_description(func, "Draw an item in the list (NOTE: when you define your own draw_item " "function, you may want to check given 'item' is of the right type...)"); - RNA_def_function_flag(func, FUNC_REGISTER); + RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL); parm = RNA_def_pointer(func, "context", "Context", "", ""); RNA_def_property_flag(parm, PROP_REQUIRED); parm = RNA_def_pointer(func, "layout", "UILayout", "", "Layout to draw the item");