From efe02a99434ae527aa0cc98bfd9392ddaef1fc32 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 19 Feb 2025 11:47:44 +1100 Subject: [PATCH] Cleanup: function argument flags for UIList.draw_item Correct two mistakes in [0] which accidentally assigned flags to the previously declared parameter as well as assigning an argument to `prop`, then setting the flags on `parm`. While it seems that "active_property" only became optional by accident leave this as-is to avoid breaking scripts. [0]: 113997a03c9b1ecc7ec6460f24781d54fd9efb57 Ref #134379. --- source/blender/makesrna/intern/rna_ui.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/source/blender/makesrna/intern/rna_ui.cc b/source/blender/makesrna/intern/rna_ui.cc index 09f30620efa..c6caf1daae6 100644 --- a/source/blender/makesrna/intern/rna_ui.cc +++ b/source/blender/makesrna/intern/rna_ui.cc @@ -2073,12 +2073,13 @@ static void rna_def_uilist(BlenderRNA *brna) 0, "", "Identifier of property in active_data, for the active element"); + RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED | PARM_PYFUNC_OPTIONAL); + parm = RNA_def_int( + func, "index", 0, 0, INT_MAX, "", "Index of the item in the collection", 0, INT_MAX); + RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED); + parm = RNA_def_property(func, "flt_flag", PROP_INT, PROP_UNSIGNED); + RNA_def_property_ui_text(parm, "", "The filter-flag result for this item"); RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED); - RNA_def_int(func, "index", 0, 0, INT_MAX, "", "Index of the item in the collection", 0, INT_MAX); - RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED | PARM_PYFUNC_OPTIONAL); - prop = RNA_def_property(func, "flt_flag", PROP_INT, PROP_UNSIGNED); - RNA_def_property_ui_text(prop, "", "The filter-flag result for this item"); - RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED | PARM_PYFUNC_OPTIONAL); /* draw_filter */ func = RNA_def_function(srna, "draw_filter", nullptr);