I want to store selection mode, then switch to other mode, bevel (or other operation), then restore first selection mode. Thanks!
1 Answer
bpy.context.tool_settings.mesh_select_mode[:]
will get your current edit selection mode. It returns which selection mode is active as True. For example:
bpy.context.tool_settings.mesh_select_mode[:]
returns:
(False, True, False)
meaning Vert mode False, Edge mode True, Face mode False
You can also request the state of a single mode using its number (starting at 0):
bpy.context.tool_settings.mesh_select_mode[1]
returns (in my case):
True
because I am in Edge Selection Mode.
select_mode = bm.select_mode
and thisselect_mode = bpy.ops.mesh.select_mode
$\endgroup$