[Bf-blender-cvs] [b192c1d] pie-menus: Expose pie animation timeo to user preferences.
Antony Riakiotakis
noreply at git.blender.org
Mon Jul 28 14:01:13 CEST 2014
Commit: b192c1da7420e9f59c3fff605c00794e4f6f2db3
Author: Antony Riakiotakis
Date: Mon Jul 28 14:00:58 2014 +0200
Branches: pie-menus
https://developer.blender.org/rBb192c1da7420e9f59c3fff605c00794e4f6f2db3
Expose pie animation timeo to user preferences.
===================================================================
M release/scripts/startup/bl_ui/space_userpref.py
M source/blender/editors/interface/interface_handlers.c
M source/blender/editors/interface/resources.c
M source/blender/makesdna/DNA_userdef_types.h
M source/blender/makesrna/intern/rna_userdef.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index 225f4e8..979e5d02 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -221,6 +221,7 @@ class USERPREF_PT_interface(Panel):
sub = col.column(align=True)
sub.prop(view, "pie_interaction_type", text="")
sub.prop(view, "pie_operator_timeout")
+ sub.prop(view, "pie_animation_timeout")
sub.prop(view, "pie_initial_timeout")
sub.prop(view, "pie_menu_radius")
sub.prop(view, "pie_menu_threshold")
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 0972b32..7fd502c 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -8607,7 +8607,7 @@ static int ui_handler_pie(bContext *C, const wmEvent *event, uiPopupBlockHandle
/* handle animation */
if (!(block->pie_data.flags & UI_PIE_ANIMATION_FINISHED)) {
uiBut *but;
- double final_time = 0.12;
+ double final_time = 0.01 * U.pie_animation_timeout;
float fac = duration / final_time;
if (fac > 1.0f) {
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c
index e756980..3b4782e 100644
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@ -2479,6 +2479,9 @@ void init_userdef_do_versions(void)
if (U.pie_operator_timeout == 0)
U.pie_operator_timeout = 20;
+ if (U.pie_animation_timeout == 0)
+ U.pie_animation_timeout = 12;
+
for (btheme = U.themes.first; btheme; btheme = btheme->next) {
btheme->tui.wcol_pie_menu = wcol_pie_menu;
}
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index ec741b7..bfa154d 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -539,7 +539,7 @@ typedef struct UserDef {
short pie_initial_timeout; /* direction in the pie menu will always be calculated from the initial position
* within this time limit */
int pie_operator_timeout; /* if button released before this time it calls an operator instead */
- int pad2;
+ int pie_animation_timeout;
short pie_menu_radius; /* pie menu radius */
short pie_menu_threshold; /* pie menu distance from center before a direction is set */
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 5ba4385..2168a50 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -3243,7 +3243,11 @@ static void rna_def_userdef_view(BlenderRNA *brna)
prop = RNA_def_property(srna, "pie_operator_timeout", PROP_INT, PROP_NONE);
RNA_def_property_range(prop, 0, 1000);
- RNA_def_property_ui_text(prop, "Operator Timeout", "Supported operators will spawn a pie menu if button is held for this amount of time (in 1/100ths of sec)");
+ RNA_def_property_ui_text(prop, "Sticky Key Timeout", "Sticky operator time after which a pie menu will be spawned if button is held for this amount of time (in 1/100ths of sec)");
+
+ prop = RNA_def_property(srna, "pie_animation_timeout", PROP_INT, PROP_NONE);
+ RNA_def_property_range(prop, 0, 1000);
+ RNA_def_property_ui_text(prop, "Animation Timeout", "Time needed to fully animate the pie to unfolded state (in 1/100ths of sec)");
prop = RNA_def_property(srna, "pie_menu_radius", PROP_INT, PROP_PIXEL);
RNA_def_property_range(prop, 0, 1000);
More information about the Bf-blender-cvs
mailing list