diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-12-22 19:11:11 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-12-22 19:11:11 +0300 |
commit | 22a892f4024db7da71ccdced00bf494c28443510 (patch) | |
tree | 591505ea18810778727110f1ef04b0b858e12c08 /source/blender/editors | |
parent | 68bc4d7355d8a13d6565d976180970af5c2d20e3 (diff) |
- make ToolSettings.mesh_selection_mode into an array of 3 bools rather then an enum since multiple can be set at once.
- ToolSettings had its id.data set to NULL when taken directly from the context (causing a crash in cases)
- menu for changing vert/edge/face selection now a python menu, removed operator.
- wm.context_set_value(), would really prefer not to have this since it evaluates the value as a python expression however there are no ways to define arrays in PyOperators
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/mesh/editmesh_mods.c | 51 | ||||
-rw-r--r-- | source/blender/editors/mesh/mesh_intern.h | 1 | ||||
-rw-r--r-- | source/blender/editors/mesh/mesh_ops.c | 3 |
3 files changed, 1 insertions, 54 deletions
diff --git a/source/blender/editors/mesh/editmesh_mods.c b/source/blender/editors/mesh/editmesh_mods.c index 0fa6ff0188c..d1dde75771d 100644 --- a/source/blender/editors/mesh/editmesh_mods.c +++ b/source/blender/editors/mesh/editmesh_mods.c @@ -3682,57 +3682,6 @@ void EM_deselect_by_material(EditMesh *em, int index) EM_selectmode_flush(em); } -static void mesh_selection_type(ToolSettings *ts, EditMesh *em, int val) -{ - if(val>0) { - //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 */ - ts->selectmode= em->selectmode; -// if (EM_texFaceCheck()) - } -} - -static int mesh_selection_type_exec(bContext *C, wmOperator *op) -{ - ToolSettings *ts= CTX_data_tool_settings(C); - Object *obedit= CTX_data_edit_object(C); - EditMesh *em= BKE_mesh_get_editmesh(((Mesh *)obedit->data)); - - 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; -} - -void MESH_OT_selection_type(wmOperatorType *ot) -{ - /* identifiers */ - ot->name= "Selection Mode"; - ot->description= "Set the selection mode type."; - ot->idname= "MESH_OT_selection_type"; - - /* api callbacks */ - ot->invoke= WM_menu_invoke; - ot->exec= mesh_selection_type_exec; - - ot->poll= ED_operator_editmesh; - - /* flags */ - ot->flag= OPTYPE_UNDO; - - /* props */ - RNA_def_enum(ot->srna, "type", mesh_select_mode_items, 0, "Type", "Set the mesh selection type"); - -} /* ************************* SEAMS AND EDGES **************** */ static int editmesh_mark_seam(bContext *C, wmOperator *op) diff --git a/source/blender/editors/mesh/mesh_intern.h b/source/blender/editors/mesh/mesh_intern.h index 5d9da374f2f..7b7257ae9cb 100644 --- a/source/blender/editors/mesh/mesh_intern.h +++ b/source/blender/editors/mesh/mesh_intern.h @@ -158,7 +158,6 @@ void MESH_OT_edges_select_sharp(struct wmOperatorType *ot); void MESH_OT_select_shortest_path(struct wmOperatorType *ot); void MESH_OT_select_similar(struct wmOperatorType *ot); void MESH_OT_select_random(struct wmOperatorType *ot); -void MESH_OT_selection_type(struct wmOperatorType *ot); void MESH_OT_loop_multi_select(struct wmOperatorType *ot); void MESH_OT_mark_seam(struct wmOperatorType *ot); void MESH_OT_mark_sharp(struct wmOperatorType *ot); diff --git a/source/blender/editors/mesh/mesh_ops.c b/source/blender/editors/mesh/mesh_ops.c index 621e952fb6d..af25dbda16b 100644 --- a/source/blender/editors/mesh/mesh_ops.c +++ b/source/blender/editors/mesh/mesh_ops.c @@ -76,7 +76,6 @@ void ED_operatortypes_mesh(void) WM_operatortype_append(MESH_OT_select_linked); WM_operatortype_append(MESH_OT_select_linked_pick); WM_operatortype_append(MESH_OT_select_random); - WM_operatortype_append(MESH_OT_selection_type); WM_operatortype_append(MESH_OT_hide); WM_operatortype_append(MESH_OT_reveal); WM_operatortype_append(MESH_OT_select_by_number_vertices); @@ -240,7 +239,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_item(keymap, "MESH_OT_selection_type", TABKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_menu(keymap, "VIEW3D_MT_edit_mesh_selection_mode", TABKEY, KM_PRESS, KM_CTRL, 0); /* hide */ WM_keymap_add_item(keymap, "MESH_OT_hide", HKEY, KM_PRESS, 0, 0); |