From 9fcc1a32df1377d22b950854fabc7af53a67b813 Mon Sep 17 00:00:00 2001 From: Antony Riakiotakis Date: Fri, 10 Oct 2014 19:13:40 +0200 Subject: Pie menus: Confirm threshold This commit adds a confirm threshold property to pie menus. Basically, this will confirm the pie menu automatically when the distance from the center of the pie exceeds that threshold without a need to release the pie button. The confirm threshold will only work if it is larger than the pie threshold. The confirmation actually occur when the mouse stops moving, to allow multiple pie menus to be better linked together, (see below) This functionality also facilitates the ability for chained pie menus by dragging. Basically, a pie menu item can be a call_menu_pie operator and the new pie menu will still use the original pie menu release event for confirmation. This should allow for quick, gesture based navigation in pie menu hierarchies (going back in the hierarchy is still not supported though) There will be a demonstration pie in the official add-on soon --- release/scripts/modules/bpy_types.py | 9 +++++---- release/scripts/startup/bl_ui/space_userpref.py | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'release') diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py index e19766310ec..c7ec7e1e54a 100644 --- a/release/scripts/modules/bpy_types.py +++ b/release/scripts/modules/bpy_types.py @@ -144,10 +144,11 @@ class WindowManager(bpy_types.ID): import bpy pie = self.piemenu_begin__internal(title, icon, event) - try: - draw_func(pie, bpy.context) - finally: - self.piemenu_end__internal(pie) + if pie: + try: + draw_func(pie, bpy.context) + finally: + self.piemenu_end__internal(pie) class _GenericBone: diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index dc18dd73abc..a7ddec040a5 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -223,6 +223,7 @@ class USERPREF_PT_interface(Panel): sub.prop(view, "pie_initial_timeout") sub.prop(view, "pie_menu_radius") sub.prop(view, "pie_menu_threshold") + sub.prop(view, "pie_menu_confirm") col.separator() col.separator() col.separator() -- cgit v1.2.3