[Bf-blender-cvs] [7c44182c4a9] master: GPencil: Minor Menu tweaks

Matias Mendiola noreply at git.blender.org
Thu Aug 29 20:13:15 CEST 2019


Commit: 7c44182c4a957bda032c49d15513682b6bbe705e
Author: Matias Mendiola
Date:   Thu Aug 29 20:11:44 2019 +0200
Branches: master
https://developer.blender.org/rB7c44182c4a957bda032c49d15513682b6bbe705e

GPencil: Minor Menu tweaks

- Added 'Hide Inactive Layers' operator and reordered 'Show/Hide' menu items
- Move 'New Layer' to bottom in 'Move to Layer' operator for consistency.
- Removed extra end points in some menu items (...)

Reviewers: antoniov, billreynish

Tags: #bf_blender, #grease_pencil

Differential Revision: https://developer.blender.org/D5626

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

M	release/scripts/startup/bl_ui/space_view3d.py
M	source/blender/editors/gpencil/gpencil_utils.c

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

diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index c40e3f1a4dd..db51523dc6c 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -4497,13 +4497,13 @@ class VIEW3D_MT_edit_gpencil_stroke(Menu):
 
         layout.separator()
 
-        layout.operator_menu_enum("gpencil.stroke_join", "type", text="Join...")
+        layout.operator_menu_enum("gpencil.stroke_join", "type", text="Join")
 
         layout.separator()
 
         layout.operator_menu_enum("gpencil.move_to_layer", "layer", text="Move to Layer")
         layout.menu("VIEW3D_MT_assign_material")
-        layout.operator_menu_enum("gpencil.stroke_arrange", "direction", text="Arrange Strokes...")
+        layout.operator_menu_enum("gpencil.stroke_arrange", "direction", text="Arrange Strokes")
 
         layout.separator()
 
@@ -4512,7 +4512,7 @@ class VIEW3D_MT_edit_gpencil_stroke(Menu):
         op.type = 'CLOSE'
         op.geometry = True
         layout.operator("gpencil.stroke_cyclical_set", text="Toggle Cyclic").type = 'TOGGLE'
-        layout.operator_menu_enum("gpencil.stroke_caps_set", text="Toggle Caps...", property="type")
+        layout.operator_menu_enum("gpencil.stroke_caps_set", text="Toggle Caps", property="type")
         layout.operator("gpencil.stroke_flip", text="Switch Direction")
 
 
@@ -4607,9 +4607,13 @@ class VIEW3D_MT_edit_gpencil_showhide(Menu):
     def draw(self, _context):
         layout = self.layout
 
-        layout.operator("gpencil.hide", text="Hide Active Layer")
         layout.operator("gpencil.reveal", text="Show All Layers")
 
+        layout.separator()
+
+        layout.operator("gpencil.hide", text="Hide Active Layer").unselected = False
+        layout.operator("gpencil.hide", text="Hide Inactive Layers").unselected = True
+
 
 class VIEW3D_MT_edit_gpencil_interpolate(Menu):
     bl_label = "Interpolate"
@@ -6388,7 +6392,7 @@ class VIEW3D_MT_gpencil_edit_context_menu(Menu):
 
             # Removal Operators
             col.operator("gpencil.stroke_merge_by_distance").use_unselected = True
-            col.operator_menu_enum("gpencil.stroke_join", "type", text="Join...")
+            col.operator_menu_enum("gpencil.stroke_join", "type", text="Join")
             col.operator("gpencil.stroke_split", text="Split")
             col.operator("gpencil.stroke_separate", text="Separate").mode = 'STROKE'
 
diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c
index 2a0f16a4bbf..25b4036b8b1 100644
--- a/source/blender/editors/gpencil/gpencil_utils.c
+++ b/source/blender/editors/gpencil/gpencil_utils.c
@@ -401,17 +401,7 @@ const EnumPropertyItem *ED_gpencil_layers_with_new_enum_itemf(bContext *C,
 
   /* Create new layer */
   /* TODO: have some way of specifying that we don't want this? */
-  {
-    /* "New Layer" entry */
-    item_tmp.identifier = "__CREATE__";
-    item_tmp.name = "New Layer";
-    item_tmp.value = -1;
-    item_tmp.icon = ICON_ADD;
-    RNA_enum_item_add(&item, &totitem, &item_tmp);
 
-    /* separator */
-    RNA_enum_item_add_separator(&item, &totitem);
-  }
   const int tot = BLI_listbase_count(&gpd->layers);
   /* Existing layers */
   for (gpl = gpd->layers.last, i = 0; gpl; gpl = gpl->prev, i++) {
@@ -428,6 +418,17 @@ const EnumPropertyItem *ED_gpencil_layers_with_new_enum_itemf(bContext *C,
 
     RNA_enum_item_add(&item, &totitem, &item_tmp);
   }
+  {
+    /* separator */
+    RNA_enum_item_add_separator(&item, &totitem);
+
+    /* "New Layer" entry */
+    item_tmp.identifier = "__CREATE__";
+    item_tmp.name = "New Layer";
+    item_tmp.value = -1;
+    item_tmp.icon = ICON_ADD;
+    RNA_enum_item_add(&item, &totitem, &item_tmp);
+  }
 
   RNA_enum_item_end(&item, &totitem);
   *r_free = true;



More information about the Bf-blender-cvs mailing list