Fix for errors caused by fixing RNA function register flags. Default UIList class now has a dummy draw_item callback. Panel draw_header is now optional (most panel classes don't define it).

This commit is contained in:
Lukas Toenne
2013-01-28 12:18:00 +00:00
parent c8d29c1af8
commit 0bf264f7ef
2 changed files with 3 additions and 2 deletions

View File

@@ -138,6 +138,7 @@ def unregister():
# Define a default UIList, when a list does not need any custom drawing...
class UI_UL_list(bpy.types.UIList):
pass
def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
pass
bpy.utils.register_class(UI_UL_list)

View File

@@ -791,7 +791,7 @@ static void rna_def_panel(BlenderRNA *brna)
func = RNA_def_function(srna, "draw_header", NULL);
RNA_def_function_ui_description(func, "Draw UI elements into the panel's header UI layout");
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 | PROP_NEVER_NULL);