Commit: 9ad3d1d36b64f336fabdd9b3d9f02b13740068b0
Author: Hans Goudey
Date:   Wed Mar 24 12:44:48 2021 -0400
Branches: master
https://developer.blender.org/rB9ad3d1d36b64f336fabdd9b3d9f02b13740068b0

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

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

M       source/blender/editors/object/object_add.c
M       source/blender/makesrna/intern/rna_object.c

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

diff --git a/source/blender/editors/object/object_add.c 
b/source/blender/editors/object/object_add.c
index b3fb497aa9a..50dc1af5ca8 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -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);
 }
 
 /** \} */
diff --git a/source/blender/makesrna/intern/rna_object.c 
b/source/blender/makesrna/intern/rna_object.c
index b04fea11a4d..b53318cfbfe 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -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,

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to