Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--release/scripts/startup/bl_ui/properties_grease_pencil_common.py56
-rw-r--r--source/blender/editors/gpencil/gpencil_ops.c3
2 files changed, 45 insertions, 14 deletions
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 b4880701290..789d0a10a9e 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 0333131bb2c..ac3ef5f35e3 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);
}
/* ==================== */