Convert Selection¶
Three small operators that switch the active mesh selection mode to vertices, edges, or faces while expanding or extending the current selection so the conversion is non-destructive where possible. They wrap bpy.ops.mesh.select_mode with sensible flags so a single keystroke does the right thing from any source mode.
Overview¶
Blender's default select-mode switch either keeps the same elements selected (no expand) or always expands. These three operators pick the conversion behaviour per target mode so the resulting selection matches what you usually want when hopping modes mid-workflow:
- To vertices: extend, so going from edges or faces to verts keeps every endpoint vert selected.
- To edges: expand only when the source was vertex mode; otherwise plain switch (faces collapse to their boundary edges as Blender's default).
- To faces: always expand, so verts/edges promote to the faces they fully define.
After each call the operator also writes tool_settings.mesh_select_mode explicitly to lock in the single-element mode (no multi-mode left over).
Usage¶
- Requires an active mesh in Edit Mode.
- Default keymap (Window keymap, from
prefs/hotkeys_default.py): iops.mesh_to_verts— Alt+F1iops.mesh_to_edges— Alt+F2iops.mesh_to_faces— Alt+F3
Notes¶
iops.mesh_to_edgeschecksmesh_select_mode[0](vertex) to decide whether to passuse_expand=True; from face mode it switches without expand, which gives the boundary-edge result.iops.mesh_to_vertsusesuse_extend=True,iops.mesh_to_facesusesuse_expand=True.- All three force a single active select-mode tuple after the switch, even if you were in a multi-mode combination.
- Registered as
REGISTER, UNDO; each conversion is a single undo step.