Cleanup: Remove unecessary enum funcs
The separator can be added directly in the enum items rather than in a callback. Differential Revision: https://developer.blender.org/D10806
This commit is contained in:
parent
a363d64b93
commit
9ad3d1d36b
|
@ -1440,32 +1440,6 @@ static int object_gpencil_add_exec(bContext *C, wmOperator *op)
|
|||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
static const EnumPropertyItem *object_gpencil_add_options(bContext *UNUSED(C),
|
||||
PointerRNA *UNUSED(ptr),
|
||||
PropertyRNA *UNUSED(prop),
|
||||
bool *r_free)
|
||||
{
|
||||
EnumPropertyItem *item = NULL;
|
||||
const EnumPropertyItem *item_ref = rna_enum_object_gpencil_type_items;
|
||||
int totitem = 0;
|
||||
int i = 0;
|
||||
int orig_count = RNA_enum_items_count(item_ref);
|
||||
|
||||
/* Default types. */
|
||||
for (i = 0; i < orig_count; i++) {
|
||||
if (item_ref[i].value == GP_LRT_SCENE) {
|
||||
/* separator before line art types */
|
||||
RNA_enum_item_add_separator(&item, &totitem);
|
||||
}
|
||||
RNA_enum_item_add(&item, &totitem, &item_ref[i]);
|
||||
}
|
||||
|
||||
RNA_enum_item_end(&item, &totitem);
|
||||
*r_free = true;
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
void OBJECT_OT_gpencil_add(wmOperatorType *ot)
|
||||
{
|
||||
/* identifiers */
|
||||
|
@ -1486,7 +1460,6 @@ void OBJECT_OT_gpencil_add(wmOperatorType *ot)
|
|||
ED_object_add_generic_props(ot, false);
|
||||
|
||||
ot->prop = RNA_def_enum(ot->srna, "type", rna_enum_object_gpencil_type_items, 0, "Type", "");
|
||||
RNA_def_enum_funcs(ot->prop, object_gpencil_add_options);
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
|
|
@ -160,6 +160,7 @@ const EnumPropertyItem rna_enum_object_gpencil_type_items[] = {
|
|||
{GP_EMPTY, "EMPTY", ICON_EMPTY_AXIS, "Blank", "Create an empty grease pencil object"},
|
||||
{GP_STROKE, "STROKE", ICON_STROKE, "Stroke", "Create a simple stroke with basic colors"},
|
||||
{GP_MONKEY, "MONKEY", ICON_MONKEY, "Monkey", "Construct a Suzanne grease pencil object"},
|
||||
{0, "", 0, NULL, NULL},
|
||||
{GP_LRT_SCENE,
|
||||
"LRT_SCENE",
|
||||
ICON_SCENE_DATA,
|
||||
|
|
Loading…
Reference in New Issue