[Bf-blender-cvs] [9241221f] pie-menus: Pie Menus:

Antony Riakiotakis noreply at git.blender.org
Thu Jul 24 17:21:12 CEST 2014


Commit: 9241221ff17c2ac4239dac5ce48bffb181cf8e6b
Author: Antony Riakiotakis
Date:   Thu Jul 24 17:05:54 2014 +0200
Branches: pie-menus
https://developer.blender.org/rB9241221ff17c2ac4239dac5ce48bffb181cf8e6b

Pie Menus:

* Fix flickering in pie menus.
* Start from center position initially.
* Fix memory over-cleanup.
* All stroke selections in paint systems use pie menus.

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

M	source/blender/editors/interface/interface_layout.c
M	source/blender/editors/sculpt_paint/paint_ops.c
M	source/blender/makesrna/intern/rna_access.c

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

diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index 241ac4c..a751848 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -2306,11 +2306,16 @@ static void ui_litem_layout_radial(uiLayout *litem)
 				/* enable drawing as pie item if supported by widget */
 				if (ui_item_is_radial_drawable(bitem))
 					bitem->but->dt = UI_EMBOSSR;
-			}
 
-			ui_item_size(item, &itemw, &itemh);
+				ui_item_size(item, &itemw, &itemh);
+
+				ui_item_position(item, x - itemw / 2, y - itemh / 2, itemw, itemh);
+			}
+			else {
+				ui_item_size(item, &itemw, &itemh);
 
-			ui_item_position(item, x + vec[0] * pie_radius - itemw / 2, y + vec[1] * pie_radius - itemh / 2, itemw, itemh);
+				ui_item_position(item, x + vec[0] * pie_radius - itemw / 2, y + vec[1] * pie_radius - itemh / 2, itemw, itemh);
+			}
 
 			minx = min_ii(minx, x + vec[0] * pie_radius - itemw / 2);
 			maxx = max_ii(maxx, x + vec[0] * pie_radius + itemw / 2);
diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c
index 8dab215..5261574 100644
--- a/source/blender/editors/sculpt_paint/paint_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_ops.c
@@ -1392,7 +1392,7 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
 	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.vertex_paint.brush.texture_angle_source_random");
 
-	kmi = WM_keymap_add_item(keymap, "WM_OT_context_menu_enum", EKEY, KM_PRESS, 0, 0);
+	kmi = WM_keymap_add_item(keymap, "WM_OT_context_pie_enum", EKEY, KM_PRESS, 0, 0);
 	RNA_string_set(kmi->ptr, "data_path", "tool_settings.vertex_paint.brush.stroke_method");
 
 	/* Weight Paint mode */
@@ -1417,7 +1417,7 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
 
 	ed_keymap_stencil(keymap);
 
-	kmi = WM_keymap_add_item(keymap, "WM_OT_context_menu_enum", EKEY, KM_PRESS, 0, 0);
+	kmi = WM_keymap_add_item(keymap, "WM_OT_context_pie_enum", EKEY, KM_PRESS, 0, 0);
 	RNA_string_set(kmi->ptr, "data_path", "tool_settings.vertex_paint.brush.stroke_method");
 
 	kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", MKEY, KM_PRESS, 0, 0); /* face mask toggle */
@@ -1469,7 +1469,7 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
 	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.image_paint.brush.texture_angle_source_random");
 
-	kmi = WM_keymap_add_item(keymap, "WM_OT_context_menu_enum", EKEY, KM_PRESS, 0, 0);
+	kmi = WM_keymap_add_item(keymap, "WM_OT_context_pie_enum", EKEY, KM_PRESS, 0, 0);
 	RNA_string_set(kmi->ptr, "data_path", "tool_settings.image_paint.brush.stroke_method");
 
 	/* face-mask mode */
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index c00eb9c..d29886e 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -1326,7 +1326,7 @@ void RNA_property_enum_items_gettexted_all(bContext *C, PointerRNA *ptr, Propert
 	if (eprop->itemf && (C != NULL || (prop->flag & PROP_ENUM_NO_CONTEXT))) {
 		EnumPropertyItem *item;
 		int i, i_fixed;
-		bool free;
+		bool free = false;
 
 		if (prop->flag & PROP_ENUM_NO_CONTEXT)
 			item = eprop->itemf(NULL, ptr, prop, &free);




More information about the Bf-blender-cvs mailing list