[Bf-blender-cvs] [45dbc8a] GPencil_EditStrokes: Experiment: Some tweaks to the Grease Pencil pie menu layout

Joshua Leung noreply at git.blender.org
Thu Nov 27 14:49:22 CET 2014


Commit: 45dbc8aa5a2e1d8393ea3c7b9503ac17221a8fdf
Author: Joshua Leung
Date:   Thu Nov 27 15:10:34 2014 +1300
Branches: GPencil_EditStrokes
https://developer.blender.org/rB45dbc8aa5a2e1d8393ea3c7b9503ac17221a8fdf

Experiment: Some tweaks to the Grease Pencil pie menu layout

Split off selection tools and copy (+ a few others not previously included)
into secondary "Select..." and "More..." pie menus accessible from the first.
This helps balance out the menu more in order to have consistency between
edit and non-editmode (i.e. the toggle option is now always in the same place),
as well as opening up more space for new tools to become accessible.

It does however seem a lot clunkier than the previous approach...

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

M	release/scripts/startup/bl_ui/properties_grease_pencil_common.py

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

diff --git a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
index 7619683..8aad8a6 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -172,13 +172,8 @@ class GPENCIL_PIE_tool_palette(Menu):
         # Editing tools
         if gpd:
             if gpd.use_stroke_edit_mode and context.editable_gpencil_strokes:
-                # S - Select
-                col = pie.column()
-                col.operator("gpencil.select_all", text="Select All", icon='PARTICLE_POINT')
-                col.operator("gpencil.select_linked", text="Select Linked", icon='LINKED')
-                col.operator("gpencil.select_border", text="Border Select", icon='BORDER_RECT')
-                col.operator("gpencil.select_circle", text="Circle Select", icon='META_EMPTY')
-                #col.operator("gpencil.select", text="Stroke Under Mouse").entire_strokes = True
+                # S - Exit Edit Mode
+                pie.prop(gpd, "use_stroke_edit_mode", text="Exit Edit Mode", icon='EDIT')
 
                 # N - Move
                 pie.operator("transform.translate", icon='MAN_TRANS').gpencil_strokes = True
@@ -189,16 +184,58 @@ class GPENCIL_PIE_tool_palette(Menu):
                 # NE - Scale
                 pie.operator("transform.resize", text="Scale", icon='MAN_SCALE').gpencil_strokes = True
 
-                # SW - Copy
-                pie.operator("gpencil.duplicate_move", icon='PARTICLE_PATH')
+                # SW - More Tools
+                pie.operator("wm.call_menu_pie", text="Select...").name = "GPENCIL_PIE_select"
 
-                # SE - Exit Edit Mode
-                pie.prop(gpd, "use_stroke_edit_mode", text="Exit Edit Mode", icon='EDIT')
+                # SE - Select
+                pie.operator("wm.call_menu_pie", text="More...").name = "GPENCIL_PIE_tools_more"
             else:
                 # Toggle Edit Mode
                 pie.prop(gpd, "use_stroke_edit_mode", text="Enable Stroke Editing", icon='EDIT')
 
 
+class GPENCIL_PIE_select(Menu):
+    """A pie menu for quick access to Grease Pencil selection tools"""
+    bl_label = "Grease Pencil Select"
+
+    @classmethod
+    def poll(cls, context):
+        gpd = context.gpencil_data
+        return bool(gpd and gpd.use_stroke_edit_mode and context.editable_gpencil_strokes)
+
+    def draw(self, context):
+        layout = self.layout
+
+        pie = layout.menu_pie()
+        gpd = context.gpencil_data
+
+        pie.operator("gpencil.select_all", text="Select All", icon='PARTICLE_POINT')
+        pie.operator("gpencil.select_linked", text="Select Linked", icon='LINKED')
+        pie.operator("gpencil.select_border", text="Border Select", icon='BORDER_RECT')
+        pie.operator("gpencil.select_circle", text="Circle Select", icon='META_EMPTY')
+
+    
+class GPENCIL_PIE_tools_more(Menu):
+    """A pie menu for quick access to Grease Pencil selection tools"""
+    bl_label = "Grease Pencil Tools"
+
+    @classmethod
+    def poll(cls, context):
+        gpd = context.gpencil_data
+        return bool(gpd and gpd.use_stroke_edit_mode and context.editable_gpencil_strokes)
+
+    def draw(self, context):
+        layout = self.layout
+
+        pie = layout.menu_pie()
+        gpd = context.gpencil_data
+
+        pie.operator("gpencil.duplicate_move", icon='PARTICLE_PATH')
+        pie.operator("transform.mirror", icon='MOD_MIRROR').gpencil_strokes = True
+        pie.operator("transform.bend").gpencil_strokes = True
+        #pie.operator("transform.warp").gpencil_strokes = True
+
+
 ###############################
 
 class GPENCIL_UL_layer(UIList):




More information about the Bf-blender-cvs mailing list