[Bf-blender-cvs] [45bff7a] pie-menus: New pies:
Antony Riakiotakis
noreply at git.blender.org
Mon Jul 28 14:46:42 CEST 2014
Commit: 45bff7af393c98a5991a9f8f0281e88f64363667
Author: Antony Riakiotakis
Date: Mon Jul 28 14:46:25 2014 +0200
Branches: pie-menus
https://developer.blender.org/rB45bff7af393c98a5991a9f8f0281e88f64363667
New pies:
* Snapping sticky pie (comma key)
* Pivot sticky pie (period key)
===================================================================
M release/scripts/startup/bl_ui/space_view3d.py
M source/blender/editors/sculpt_paint/paint_ops.c
M source/blender/editors/space_view3d/view3d_ops.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 5bb4277..74bf703 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -1450,6 +1450,28 @@ class VIEW3D_PIE_manipulator(Menu):
pie.prop(context.space_data, "show_manipulator")
+class VIEW3D_PIE_pivot(Menu):
+ bl_label = "Pivot"
+
+ def draw(self, context):
+ layout = self.layout
+
+ pie = layout.menu_pie()
+ pie.prop(context.space_data, "pivot_point", expand=True)
+ pie.prop(context.space_data, "use_pivot_point_align")
+
+class VIEW3D_PIE_snap(Menu):
+ bl_label = "Snapping"
+
+ def draw(self, context):
+ layout = self.layout
+
+ toolsettings = context.tool_settings
+ pie = layout.menu_pie()
+ pie.prop(toolsettings, "snap_element", expand=True)
+ pie.prop(toolsettings, "use_snap")
+
+
# ********** Brush menu **********
class VIEW3D_MT_brush(Menu):
bl_label = "Brush"
diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c
index e2bde5e..2783443 100644
--- a/source/blender/editors/sculpt_paint/paint_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_ops.c
@@ -1362,7 +1362,6 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
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");
-
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");
diff --git a/source/blender/editors/space_view3d/view3d_ops.c b/source/blender/editors/space_view3d/view3d_ops.c
index 664d1d3..f4f16d9 100644
--- a/source/blender/editors/space_view3d/view3d_ops.c
+++ b/source/blender/editors/space_view3d/view3d_ops.c
@@ -153,6 +153,24 @@ void ED_operatormacros_screen(void)
if (ptr) {
RNA_string_set(ptr, "data_path", "space_data.show_manipulator");
}
+
+ ptr = WM_operator_pie_macro("VIEW3D_PIE_pivot_macro", "Pivot",
+ "Pivot Options for the viewport",
+ OPTYPE_UNDO | OPTYPE_REGISTER, "WM_OT_context_set_enum", "VIEW3D_PIE_pivot");
+
+ if (ptr) {
+ RNA_string_set(ptr, "data_path", "space_data.pivot_point");
+ RNA_string_set(ptr, "value", "CURSOR");
+ }
+
+ ptr = WM_operator_pie_macro("VIEW3D_PIE_snap_macro", "Snap",
+ "Snapping Options for the viewport",
+ OPTYPE_UNDO | OPTYPE_REGISTER, "WM_OT_context_set_enum", "VIEW3D_PIE_snap");
+
+ if (ptr) {
+ RNA_string_set(ptr, "data_path", "space_data.pivot_point");
+ RNA_string_set(ptr, "value", "BOUNDING_BOX_CENTER");
+ }
}
@@ -508,10 +526,6 @@ void view3d_keymap(wmKeyConfig *keyconf)
WM_keymap_add_item(keymap, "VIEW3D_OT_pastebuffer", VKEY, KM_PRESS, KM_CTRL, 0);
/* context ops */
- kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", COMMAKEY, KM_PRESS, 0, 0);
- RNA_string_set(kmi->ptr, "data_path", "space_data.pivot_point");
- RNA_string_set(kmi->ptr, "value", "BOUNDING_BOX_CENTER");
-
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", COMMAKEY, KM_PRESS, KM_CTRL, 0); /* 2.4x allowed Comma+Shift too, rather not use both */
RNA_string_set(kmi->ptr, "data_path", "space_data.pivot_point");
RNA_string_set(kmi->ptr, "value", "MEDIAN_POINT");
@@ -521,9 +535,8 @@ void view3d_keymap(wmKeyConfig *keyconf)
kmi = WM_keymap_add_item(keymap, "VIEW3D_PIE_manipulator_macro", SPACEKEY, KM_PRESS, KM_CTRL, 0); /* new in 2.5 */
- kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", PERIODKEY, KM_PRESS, 0, 0);
- RNA_string_set(kmi->ptr, "data_path", "space_data.pivot_point");
- RNA_string_set(kmi->ptr, "value", "CURSOR");
+ kmi = WM_keymap_add_item(keymap, "VIEW3D_PIE_pivot_macro", PERIODKEY, KM_PRESS, 0, 0);
+ kmi = WM_keymap_add_item(keymap, "VIEW3D_PIE_snap_macro", COMMAKEY, KM_PRESS, 0, 0);
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", PERIODKEY, KM_PRESS, KM_CTRL, 0);
RNA_string_set(kmi->ptr, "data_path", "space_data.pivot_point");
More information about the Bf-blender-cvs
mailing list