Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Poirier <theeth@yahoo.com>2009-11-26 22:32:33 +0300
committerMartin Poirier <theeth@yahoo.com>2009-11-26 22:32:33 +0300
commit6ca1c913d3acee63a275259f9a708a1389c23b81 (patch)
tree5f07bcf5a1b5908db6dc0ed04d3f0089f1e000b5 /source/blender/editors/mesh/editmesh_mods.c
parentb658febb6a427b6e6272874d1b9681441e923fcc (diff)
Simplify mesh selection type operator and add missing header refresh notifier.
Also remove REGISTER flag from operator (no need to see this in operator history).
Diffstat (limited to 'source/blender/editors/mesh/editmesh_mods.c')
-rw-r--r--source/blender/editors/mesh/editmesh_mods.c33
1 files changed, 9 insertions, 24 deletions
diff --git a/source/blender/editors/mesh/editmesh_mods.c b/source/blender/editors/mesh/editmesh_mods.c
index 2d1452c8cb1..8501b7fba92 100644
--- a/source/blender/editors/mesh/editmesh_mods.c
+++ b/source/blender/editors/mesh/editmesh_mods.c
@@ -82,6 +82,7 @@ editmesh_mods.c, UI level access, no geometry changes
#include "RNA_access.h"
#include "RNA_define.h"
+#include "RNA_enum_types.h"
#include "ED_mesh.h"
#include "ED_screen.h"
@@ -3663,21 +3664,11 @@ void EM_deselect_by_material(EditMesh *em, int index)
static void mesh_selection_type(ToolSettings *ts, EditMesh *em, int val)
{
if(val>0) {
- if(val==1) {
- em->selectmode= SCE_SELECT_VERTEX;
- EM_selectmode_set(em);
- }
- else if(val==2) {
- //if(ctrl) EM_convertsel(em, em->selectmode, SCE_SELECT_EDGE);
- em->selectmode= SCE_SELECT_EDGE;
- EM_selectmode_set(em);
- }
-
- else{
- //if((ctrl)) EM_convertsel(em, em->selectmode, SCE_SELECT_FACE);
- em->selectmode= SCE_SELECT_FACE;
- EM_selectmode_set(em);
- }
+ //if(ctrl) EM_convertsel(em, em->selectmode, SCE_SELECT_EDGE);
+ //if((ctrl)) EM_convertsel(em, em->selectmode, SCE_SELECT_FACE);
+
+ em->selectmode= val;
+ EM_selectmode_set(em);
/* note, em stores selectmode to be able to pass it on everywhere without scene,
this is only until all select modes and toolsettings are settled more */
@@ -3686,13 +3677,6 @@ static void mesh_selection_type(ToolSettings *ts, EditMesh *em, int val)
}
}
-static EnumPropertyItem prop_mesh_edit_types[] = {
- {1, "VERT", ICON_VERTEXSEL, "Vertices", ""},
- {2, "EDGE", ICON_EDGESEL, "Edges", ""},
- {3, "FACE", ICON_FACESEL, "Faces", ""},
- {0, NULL, 0, NULL, NULL}
-};
-
static int mesh_selection_type_exec(bContext *C, wmOperator *op)
{
ToolSettings *ts= CTX_data_tool_settings(C);
@@ -3702,6 +3686,7 @@ static int mesh_selection_type_exec(bContext *C, wmOperator *op)
mesh_selection_type(ts, em, RNA_enum_get(op->ptr,"type"));
WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data);
+ WM_event_add_notifier(C, NC_SCENE|ND_MODE, NULL); /* header redraw */
BKE_mesh_end_editmesh(obedit->data, em);
return OPERATOR_FINISHED;
@@ -3721,10 +3706,10 @@ void MESH_OT_selection_type(wmOperatorType *ot)
ot->poll= ED_operator_editmesh;
/* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ ot->flag= OPTYPE_UNDO;
/* props */
- RNA_def_enum(ot->srna, "type", prop_mesh_edit_types, 0, "Type", "Set the mesh selection type");
+ RNA_def_enum(ot->srna, "type", mesh_select_mode_items, 0, "Type", "Set the mesh selection type");
}
/* ************************* SEAMS AND EDGES **************** */