[Bf-blender-cvs] [a88a9a7] GPencil_EditStrokes: Polish for quick-access pie menus

Joshua Leung noreply at git.blender.org
Sun Nov 30 13:00:32 CET 2014


Commit: a88a9a74bc6a395451c2e3141a16cec4dab11745
Author: Joshua Leung
Date:   Mon Dec 1 00:22:25 2014 +1300
Branches: GPencil_EditStrokes
https://developer.blender.org/rBa88a9a74bc6a395451c2e3141a16cec4dab11745

Polish for quick-access pie menus

* Settings pie menu (DQ) can now be used to quickly check on and adjust
  key properties for the active layer. In particular, it's particularly
  helpful for quickly checking colours and turning onion skinning on/off.

* Fleshed out the "More" pie with many of the other tools as well. Also
  included a link back to the main tools pie (i.e. the one launched with Ctrl-D)

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

M	release/scripts/startup/bl_ui/properties_grease_pencil_common.py
M	source/blender/editors/gpencil/gpencil_ops.c

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

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 b488070..789d0a1 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -167,7 +167,13 @@ class GPENCIL_PIE_tool_palette(Menu):
 
         # E - Eraser
         # XXX: needs a dedicated icon...
-        pie.operator("gpencil.draw", text="Eraser", icon='FORCE_CURVE').mode = 'ERASER'
+        col = pie.column()
+        col.operator("gpencil.draw", text="Eraser", icon='FORCE_CURVE').mode = 'ERASER'
+
+        # E - "Settings" Palette is included here too, since it needs to be in a stable position...
+        if gpd and gpd.layers.active:
+            col.separator()
+            col.operator("wm.call_menu_pie", text="Settings...", icon='SCRIPTWIN').name = "GPENCIL_PIE_settings_palette"
 
         # Editing tools
         if gpd:
@@ -208,14 +214,13 @@ class GPENCIL_PIE_tool_palette(Menu):
                 pie.prop(gpd, "use_stroke_edit_mode", text="Enable Stroke Editing", icon='EDIT')
 
 
-class GPENCIL_PIE_tools_more(Menu):
-    """A pie menu for quick access to Grease Pencil selection tools"""
-    bl_label = "More Grease Pencil Tools"
+class GPENCIL_PIE_settings_palette(Menu):
+    """A pie menu for quick access to Grease Pencil settings"""
+    bl_label = "Grease Pencil Settings"
 
     @classmethod
     def poll(cls, context):
-        gpd = context.gpencil_data
-        return bool(gpd and gpd.use_stroke_edit_mode and context.editable_gpencil_strokes)
+        return bool(context.gpencil_data and context.active_gpencil_layer)
 
     def draw(self, context):
         layout = self.layout
@@ -243,16 +248,41 @@ class GPENCIL_PIE_tools_more(Menu):
         col.prop(gpl, "use_onion_skinning")
 
         # N - Active Layer
-        #XXX
+        # XXX: this should show an operator to change the active layer instead
         col = pie.column()
-        col.label("Active Layer:")
-        col.prop(gpl, "info")
+        col.label("Active Layer:      ")
+        col.prop(gpl, "info", text="")
+        #col.prop(gpd, "layers")
+        row = col.row()
+        row.prop(gpl, "lock")
+        row.prop(gpl, "hide")
+
+        
+class GPENCIL_PIE_tools_more(Menu):
+    """A pie menu for accessing more Grease Pencil tools"""
+    bl_label = "More 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.select_more", icon='ZOOMIN')
+        pie.operator("gpencil.select_less", icon='ZOOMOUT')
 		
-        # (Others) - Other tools
-        # XXX: these shouldn't be here?
         pie.operator("transform.mirror", icon='MOD_MIRROR').gpencil_strokes = True
-        pie.operator("transform.bend").gpencil_strokes = True
-        #pie.operator("transform.warp").gpencil_strokes = True
+        pie.operator("transform.bend", icon='MOD_SIMPLEDEFORM').gpencil_strokes = True
+        pie.operator("transform.shear", icon='MOD_TRIANGULATE').gpencil_strokes = True
+        pie.operator("transform.tosphere", icon='MOD_MULTIRES').gpencil_strokes = True
+		
+        pie.operator("gpencil.convert", icon='OUTLINER_OB_CURVE')
+        pie.operator("wm.call_menu_pie", text="Back to Main Palette...").name = "GPENCIL_PIE_tool_palette"
 
 ###############################
 
diff --git a/source/blender/editors/gpencil/gpencil_ops.c b/source/blender/editors/gpencil/gpencil_ops.c
index 0333131..ac3ef5f 100644
--- a/source/blender/editors/gpencil/gpencil_ops.c
+++ b/source/blender/editors/gpencil/gpencil_ops.c
@@ -66,7 +66,7 @@ static void ed_keymap_gpencil_general(wmKeyConfig *keyconf)
 	RNA_enum_set(kmi->ptr, "mode", GP_PAINTMODE_DRAW);
 	RNA_boolean_set(kmi->ptr, "wait_for_input", false);
 	
-#if 0
+#if 0 // XXX: disabled, since they won't be of any use anymore
 	/* draw - straight lines */
 	kmi = WM_keymap_add_item(keymap, "GPENCIL_OT_draw", LEFTMOUSE, KM_PRESS, KM_CTRL, DKEY);
 	RNA_enum_set(kmi->ptr, "mode", GP_PAINTMODE_DRAW_STRAIGHT);
@@ -91,6 +91,7 @@ static void ed_keymap_gpencil_general(wmKeyConfig *keyconf)
 	
 	/* Pie Menu - For standard tools */
 	WM_keymap_add_menu_pie(keymap, "GPENCIL_PIE_tool_palette", DKEY, KM_PRESS, KM_CTRL, 0);
+	WM_keymap_add_menu_pie(keymap, "GPENCIL_PIE_settings_palette", QKEY, KM_PRESS, 0, DKEY);
 }
 
 /* ==================== */




More information about the Bf-blender-cvs mailing list