[Bf-blender-cvs] [cfb0ae2] pie-menus: For ease of testing, move object mode switch pie to be active across all modes. Also modify custom python example pie and put it to Q key, sculpt mode.
Antony Riakiotakis
noreply at git.blender.org
Sat May 31 00:20:39 CEST 2014
Commit: cfb0ae2a1776b20f37103ed01efc7cadb7446164
Author: Antony Riakiotakis
Date: Sat May 31 01:05:12 2014 +0300
https://developer.blender.org/rBcfb0ae2a1776b20f37103ed01efc7cadb7446164
For ease of testing, move object mode switch pie to be active across all
modes. Also modify custom python example pie and put it to Q key, sculpt mode.
===================================================================
M release/scripts/startup/bl_ui/space_view3d_toolbar.py
M source/blender/editors/object/object_ops.c
M source/blender/editors/sculpt_paint/paint_ops.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index fa8b33a..bbfa8f3 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -1667,16 +1667,26 @@ class VIEW3D_PT_tools_grease_pencil(GreasePencilPanel, Panel):
bl_region_type = 'TOOLS'
bl_category = "Grease Pencil"
-class VIEW3D_PIE_object_mode(Menu):
- bl_label = "Pies!"
+class VIEW3D_PIE_tests(Menu):
+ bl_label = "Testing Pie"
def draw(self, context):
layout = self.layout
+ toolsettings = context.tool_settings
+ sculpt = toolsettings.sculpt
+ brush = sculpt.brush
+
pie = layout.pie()
- pie.operator_enum("object.mode_set", "mode")
- #pie.label("blackberry")
- #pie.label("cheese")
+ pie.prop(sculpt, "use_symmetry_x", text="X", toggle=True)
+ pie.prop(sculpt, "use_symmetry_y", text="Y", toggle=True)
+ pie.prop(sculpt, "use_symmetry_z", text="Z", toggle=True)
+ pie.prop(brush, "strength")
+
+ @classmethod
+ def poll(cls, context):
+ return (context.sculpt_object and context.tool_settings.sculpt)
+
if __name__ == "__main__": # only for live edit.
bpy.utils.register_module(__name__)
diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c
index 040c942..3bafbbd 100644
--- a/source/blender/editors/object/object_ops.c
+++ b/source/blender/editors/object/object_ops.c
@@ -288,7 +288,12 @@ void ED_keymap_object(wmKeyConfig *keyconf)
/* Objects, Regardless of Mode -------------------------------------------------- */
keymap = WM_keymap_find(keyconf, "Object Non-modal", 0, 0);
-
+
+ kmi = WM_keymap_add_item(keymap, "WM_OT_context_operator_pie_enum", TABKEY, KM_PRESS, 0, 0);
+ RNA_string_set(kmi->ptr, "data_path", "object.mode_set.mode");
+ RNA_string_set(kmi->ptr, "title", "Object Mode");
+
+#if 0
/* Note: this keymap works disregarding mode */
kmi = WM_keymap_add_item(keymap, "OBJECT_OT_mode_set", TABKEY, KM_PRESS, 0, 0);
RNA_enum_set(kmi->ptr, "mode", OB_MODE_EDIT);
@@ -304,9 +309,9 @@ void ED_keymap_object(wmKeyConfig *keyconf)
kmi = WM_keymap_add_item(keymap, "OBJECT_OT_mode_set", TABKEY, KM_PRESS, KM_CTRL, 0);
RNA_enum_set(kmi->ptr, "mode", OB_MODE_WEIGHT_PAINT);
+ RNA_boolean_set(kmi->ptr, "toggle", true);
+#endif
- RNA_boolean_set(kmi->ptr, "toggle", true);
-
WM_keymap_add_item(keymap, "OBJECT_OT_origin_set", CKEY, KM_PRESS, KM_ALT | KM_SHIFT | KM_CTRL, 0);
/* Object Mode ---------------------------------------------------------------- */
diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c
index a2a4773..66735c1 100644
--- a/source/blender/editors/sculpt_paint/paint_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_ops.c
@@ -1191,16 +1191,14 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
RNA_boolean_set(kmi->ptr, "create_missing", 1);
/* */
- kmi = WM_keymap_add_item(keymap, "WM_OT_context_operator_pie_enum", TABKEY, KM_PRESS, 0, 0);
- RNA_string_set(kmi->ptr, "data_path", "object.mode_set.mode");
- RNA_string_set(kmi->ptr, "title", "Object Mode");
-
kmi = WM_keymap_add_item(keymap, "WM_OT_context_pie_enum", AKEY, KM_PRESS, 0, 0);
RNA_string_set(kmi->ptr, "data_path", "tool_settings.sculpt.brush.stroke_method");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", SKEY, KM_PRESS, KM_SHIFT, 0);
RNA_string_set(kmi->ptr, "data_path", "tool_settings.sculpt.brush.use_smooth_stroke");
+ WM_keymap_add_pie_menu(keymap, "VIEW3D_PIE_tests", QKEY, KM_PRESS, 0, 0);
+
kmi = WM_keymap_add_item(keymap, "WM_OT_context_menu_enum", RKEY, KM_PRESS, 0, 0);
RNA_string_set(kmi->ptr, "data_path", "tool_settings.sculpt.brush.texture_angle_source_random");
More information about the Bf-blender-cvs
mailing list