Commit: 5fd10b15a6847b07376f620d11d829c92ab1970a
Author: Antony Riakiotakis
Date:   Tue Jul 29 12:11:23 2014 +0200
Branches: pie-menus
https://developer.blender.org/rB5fd10b15a6847b07376f620d11d829c92ab1970a

Revert "Pie Menus:"

This reverts commit 0d92435a71b8dfe7896a5f28b0ac778fdf383e15.

The reason is that the operator needs greater changes for this to work
correctly, may even better to have a new operator for this operation

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

M       release/scripts/startup/bl_ui/space_view3d.py
M       source/blender/editors/mesh/editmesh_select.c
M       source/blender/editors/mesh/mesh_ops.c
M       source/blender/editors/space_view3d/view3d_ops.c
M       source/blender/windowmanager/WM_keymap.h
M       source/blender/windowmanager/intern/wm_keymap.c

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

diff --git a/release/scripts/startup/bl_ui/space_view3d.py 
b/release/scripts/startup/bl_ui/space_view3d.py
index ca5dc2a..2b337d5 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -2167,7 +2167,10 @@ class VIEW3D_MT_edit_mesh_select_mode(Menu):
 
         layout.operator_context = 'INVOKE_REGION_WIN'
         pie = layout.menu_pie()
-        pie.operator_enum("mesh.select_mode", "type")
+        pie.operator("mesh.select_mode", text="Vertex", icon='VERTEXSEL').type 
= 'VERT'
+        pie.operator("mesh.select_mode", text="Edge", icon='EDGESEL').type = 
'EDGE'
+        pie.operator("mesh.select_mode", text="Face", icon='FACESEL').type = 
'FACE'
+
 
 class VIEW3D_MT_edit_mesh_extrude(Menu):
     bl_label = "Extrude"
diff --git a/source/blender/editors/mesh/editmesh_select.c 
b/source/blender/editors/mesh/editmesh_select.c
index 8c648b1..9cdfb43 100644
--- a/source/blender/editors/mesh/editmesh_select.c
+++ b/source/blender/editors/mesh/editmesh_select.c
@@ -44,7 +44,6 @@
 #include "BKE_report.h"
 #include "BKE_paint.h"
 #include "BKE_editmesh.h"
-#include "BKE_mesh.h"
 
 #include "IMB_imbuf_types.h"
 #include "IMB_imbuf.h"
@@ -939,27 +938,6 @@ static int edbm_select_mode_exec(bContext *C, wmOperator 
*op)
        const bool use_extend = RNA_boolean_get(op->ptr, "use_extend");
        const bool use_expand = RNA_boolean_get(op->ptr, "use_expand");
 
-       if (!is_power_of_2_i(type)) {
-               Scene *scene = CTX_data_scene(C);
-               ToolSettings *ts = scene->toolsettings;
-
-               ts->selectmode = type;
-
-               if (scene->basact) {
-                       Object *obact = scene->basact->object;
-                       Mesh *me = BKE_mesh_from_object(obact);
-                       if (me && me->edit_btmesh && 
me->edit_btmesh->selectmode != type) {
-                               me->edit_btmesh->selectmode = type;
-                               EDBM_selectmode_set(me->edit_btmesh);
-                               WM_event_add_notifier(C, NC_GEOM | ND_SELECT, 
obact->data);
-                               WM_main_add_notifier(NC_SCENE | 
ND_TOOLSETTINGS, NULL);
-                               return OPERATOR_FINISHED;
-                       }
-               }
-
-               return OPERATOR_CANCELLED;
-       }
-
        if (EDBM_selectmode_toggle(C, type, action, use_extend, use_expand)) {
                return OPERATOR_FINISHED;
        }
@@ -985,14 +963,10 @@ void MESH_OT_select_mode(wmOperatorType *ot)
        PropertyRNA *prop;
 
        static EnumPropertyItem elem_items[] = {
-               {SCE_SELECT_VERTEX, "VERTEX", ICON_VERTEXSEL, "Vertex", "Vertex 
selection mode"},
-               {SCE_SELECT_EDGE, "EDGE", ICON_EDGESEL, "Edge", "Edge selection 
mode"},
-               {SCE_SELECT_FACE, "FACE", ICON_FACESEL, "Face", "Face selection 
mode"},
-           {SCE_SELECT_VERTEX | SCE_SELECT_FACE, "VERTEX_FACE", ICON_FACESEL, 
"Vertex/Face", "Vertex and Face selection mode"},
-           {SCE_SELECT_VERTEX | SCE_SELECT_EDGE, "VERTEX_EDGE", 
ICON_VERTEXSEL, "Vertex/Edge", "Vertex and Edge selection mode"},
-           {SCE_SELECT_FACE | SCE_SELECT_EDGE, "FACE_EDGE", ICON_EDGESEL, 
"Face/Edge", "Face and Edge selection mode"},
-           {SCE_SELECT_VERTEX | SCE_SELECT_EDGE | SCE_SELECT_FACE, "ALL", 
ICON_FACESEL, "All", "All selection modes"},
-               {0, NULL, 0, NULL, NULL}
+               {SCE_SELECT_VERTEX, "VERT", ICON_VERTEXSEL, "Vertices", ""},
+               {SCE_SELECT_EDGE,   "EDGE", ICON_EDGESEL, "Edges", ""},
+               {SCE_SELECT_FACE,   "FACE", ICON_FACESEL, "Faces", ""},
+               {0, NULL, 0, NULL, NULL},
        };
 
        static EnumPropertyItem actions_items[] = {
diff --git a/source/blender/editors/mesh/mesh_ops.c 
b/source/blender/editors/mesh/mesh_ops.c
index 657d99c..abf4d88 100644
--- a/source/blender/editors/mesh/mesh_ops.c
+++ b/source/blender/editors/mesh/mesh_ops.c
@@ -349,7 +349,7 @@ void ED_keymap_mesh(wmKeyConfig *keyconf)
        WM_keymap_add_item(keymap, "MESH_OT_select_similar", GKEY, KM_PRESS, 
KM_SHIFT, 0);
        
        /* selection mode */
-       WM_keymap_add_pie_menu(keymap, "VIEW3D_MT_edit_mesh_select_mode", 
TABKEY, KM_PRESS, KM_CTRL, 0);
+       WM_keymap_add_pie_menu(keymap, "VIEW3D_MT_edit_mesh_select_mode", 
TABKEY, KM_PRESS, KM_CTRL, 0, true);
        
        /* hide */
        kmi = WM_keymap_add_item(keymap, "MESH_OT_hide", HKEY, KM_PRESS, 0, 0);
diff --git a/source/blender/editors/space_view3d/view3d_ops.c 
b/source/blender/editors/space_view3d/view3d_ops.c
index b28a336..f4f16d9 100644
--- a/source/blender/editors/space_view3d/view3d_ops.c
+++ b/source/blender/editors/space_view3d/view3d_ops.c
@@ -320,7 +320,7 @@ void view3d_keymap(wmKeyConfig *keyconf)
        RNA_boolean_set(kmi->ptr, "center", true);
 
        /* numpad view hotkeys*/
-       WM_keymap_add_pie_menu(keymap, "VIEW3D_PIE_view", QKEY, KM_PRESS, 0, 0);
+       WM_keymap_add_pie_menu(keymap, "VIEW3D_PIE_view", QKEY, KM_PRESS, 0, 0, 
false);
 
        RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD0, 
KM_PRESS, 0, 0)->ptr, "type", RV3D_VIEW_CAMERA);
        RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD1, 
KM_PRESS, 0, 0)->ptr, "type", RV3D_VIEW_FRONT);
diff --git a/source/blender/windowmanager/WM_keymap.h 
b/source/blender/windowmanager/WM_keymap.h
index bf81972..c609549 100644
--- a/source/blender/windowmanager/WM_keymap.h
+++ b/source/blender/windowmanager/WM_keymap.h
@@ -65,7 +65,7 @@ wmKeyMapItem *WM_keymap_add_item(struct wmKeyMap *keymap, 
const char *idname, in
 wmKeyMapItem *WM_keymap_add_menu(struct wmKeyMap *keymap, const char *idname, 
int type,
                                  int val, int modifier, int keymodifier);
 wmKeyMapItem *WM_keymap_add_pie_menu(struct wmKeyMap *keymap, const char 
*idname, int type,
-                                     int val, int modifier, int keymodifier);
+                                     int val, int modifier, int keymodifier, 
bool force_click);
 
 bool        WM_keymap_remove_item(struct wmKeyMap *keymap, struct wmKeyMapItem 
*kmi);
 int         WM_keymap_item_to_string(wmKeyMapItem *kmi, char *str, const int 
len);
diff --git a/source/blender/windowmanager/intern/wm_keymap.c 
b/source/blender/windowmanager/intern/wm_keymap.c
index 8a54c1b..568b63f 100644
--- a/source/blender/windowmanager/intern/wm_keymap.c
+++ b/source/blender/windowmanager/intern/wm_keymap.c
@@ -464,11 +464,11 @@ wmKeyMapItem *WM_keymap_add_menu(wmKeyMap *keymap, const 
char *idname, int type,
        return kmi;
 }
 
-wmKeyMapItem *WM_keymap_add_pie_menu(wmKeyMap *keymap, const char *idname, int 
type, int val, int modifier, int keymodifier)
+wmKeyMapItem *WM_keymap_add_pie_menu(wmKeyMap *keymap, const char *idname, int 
type, int val, int modifier, int keymodifier, bool force_click)
 {
        wmKeyMapItem *kmi = WM_keymap_add_item(keymap, "WM_OT_call_pie_menu", 
type, val, modifier, keymodifier);
        RNA_string_set(kmi->ptr, "name", idname);
-       RNA_boolean_set(kmi->ptr, "force_click", false);
+       RNA_boolean_set(kmi->ptr, "force_click", force_click);
        return kmi;
 }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to