Change the mesh_select_mode property to switch in mesh edit mode between vertex, edge and polygon selection mode in Blender.
For vertex selection mode:
1 |
bpy.context.tool_settings.mesh_select_mode = (True, False, False) |
Edge selection mode:
1 |
bpy.context.tool_settings.mesh_select_mode = (False, True, False) |
And face selection mode:
1 |
bpy.context.tool_settings.mesh_select_mode = (False, False, True) |
The multi-select mode is enabled too. For example for vertex and face selection mode:
1 |
bpy.context.tool_settings.mesh_select_mode = (True, False, True) |
In BMesh for vertex, edge and face selection mode:
1 2 3 |
bm.select_mode = {'VERT'} bm.select_mode = {'EDGE'} bm.select_mode = {'FACE'} |
For multi-select in BMesh:
1 |
bm.select_mode = {'VERT', 'EDGE', 'FACE'} |