[Bf-blender-cvs] [dc1d95e] GPencil_Editing_Stage3: GP Sculpt: Experimental pie menu for sculptmode (D+E)

Joshua Leung noreply at git.blender.org
Fri Jul 24 17:11:03 CEST 2015


Commit: dc1d95e4046fbfe529f6363058130a342a37a0e6
Author: Joshua Leung
Date:   Sat Jul 25 03:10:44 2015 +1200
Branches: GPencil_Editing_Stage3
https://developer.blender.org/rBdc1d95e4046fbfe529f6363058130a342a37a0e6

GP Sculpt: Experimental pie menu for sculptmode (D+E)

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

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 b7f828b..0d10d54 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -339,6 +339,39 @@ class GPENCIL_PIE_tools_more(Menu):
         pie.operator("wm.call_menu_pie", text="Back to Main Palette...").name = "GPENCIL_PIE_tool_palette"
 
 
+class GPENCIL_PIE_sculpt(Menu):
+    """A pie menu for accessing Grease Pencil stroke sculpting settings"""
+    bl_label = "Grease Pencil Sculpt"
+
+    @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()
+
+        settings = context.tool_settings.gpencil_sculpt
+        brush = settings.brush
+
+        col = pie.column()
+        #col.label("Tool:")
+        col.prop(settings, "tool", text="")
+        col.operator("gpencil.brush_paint", text="Sculpt", icon='SCULPTMODE_HLT')
+
+        col = pie.column(align=True)
+        col.prop(brush, "size", slider=True)
+        row = col.row(align=True)
+        row.prop(brush, "strength", slider=True)
+       # row.prop(brush, "use_pressure_strength", text="", icon_only=True)
+        col.prop(brush, "use_falloff")
+
+
+###############################
+
+
 class GPENCIL_UL_layer(UIList):
     def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
         # assert(isinstance(item, bpy.types.GPencilLayer)
diff --git a/source/blender/editors/gpencil/gpencil_ops.c b/source/blender/editors/gpencil/gpencil_ops.c
index 24ee352..eafa801 100644
--- a/source/blender/editors/gpencil/gpencil_ops.c
+++ b/source/blender/editors/gpencil/gpencil_ops.c
@@ -114,6 +114,9 @@ static void ed_keymap_gpencil_editing(wmKeyConfig *keyconf)
 	kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", TABKEY, KM_PRESS, 0, 0);
 	RNA_string_set(kmi->ptr, "data_path", "gpencil_data.use_stroke_edit_mode");
 	
+	/* Pie Menu - For settings/tools easy access */
+	WM_keymap_add_menu_pie(keymap, "GPENCIL_PIE_sculpt", EKEY, KM_PRESS, 0, DKEY);
+	
 	/* Brush Settings */
 	/* NOTE: We cannot expose these in the standard keymap, as they will interfere with regular hotkeys
 	 *       in other modes. However, when we are dealing with Stroke Edit Mode, we know for certain




More information about the Bf-blender-cvs mailing list