[Bf-blender-cvs] [a416b3e2108] lanpr-under-gp: LineArt: Cleanup enum callback for quick line art.

YimingWu noreply at git.blender.org
Tue Jul 28 11:41:14 CEST 2020


Commit: a416b3e2108fc7d4d82e308a8ff1dbbee89f0f52
Author: YimingWu
Date:   Tue Jul 28 17:40:28 2020 +0800
Branches: lanpr-under-gp
https://developer.blender.org/rBa416b3e2108fc7d4d82e308a8ff1dbbee89f0f52

LineArt: Cleanup enum callback for quick line art.

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

M	source/blender/editors/object/object_add.c

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

diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index f48dbc67d58..34548c09e90 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -1310,26 +1310,19 @@ const EnumPropertyItem *object_gpencil_add_options(bContext *C,
   int i = 0;
   int orig_count = RNA_enum_items_count(item_ref);
 
-  if (ELEM(NULL, C, gpd)) {
-    return item_ref;
-  }
-
-  /* Create new layer */
-  /* TODO: have some way of specifying that we don't want this? */
-
-  const int tot = BLI_listbase_count(&gpd->layers);
-
   /* Default types. */
   for (i = 0; i < orig_count; i++) {
     if (item_ref[i].value == GP_LRT_OBJECT || item_ref[i].value == GP_LRT_COLLECTION) {
 #ifdef WITH_LINEART
-      if (item_ref[i].value == GP_LRT_OBJECT) {
+      if (item_ref[i].value == GP_LRT_COLLECTION) {
+        /* separator before line art types */
+        RNA_enum_item_add_separator(&item, &totitem);
+      }
+      else if (item_ref[i].value == GP_LRT_OBJECT) {
         Object *ob = CTX_data_active_object(C);
         if (!ob || ob->type != OB_MESH) {
           continue;
         }
-        /* separator before line art types */
-        RNA_enum_item_add_separator(&item, &totitem);
       }
 #else
       /* Don't show line art options when not compiled with one. */



More information about the Bf-blender-cvs mailing list