0
$\begingroup$

I want to store selection mode, then switch to other mode, bevel (or other operation), then restore first selection mode. Thanks!

$\endgroup$
2
  • $\begingroup$ I think you are using incorrect terminology. Selection modes stay the same outside of what tools you are using, unless you're using the selection TOOL, which I never use. $\endgroup$
    – TheLabCat
    Jan 7, 2021 at 1:11
  • $\begingroup$ I meant this select_mode = bm.select_mode and this select_mode = bpy.ops.mesh.select_mode $\endgroup$
    – APEC
    Jan 7, 2021 at 8:32

1 Answer 1

2
$\begingroup$
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.

https://docs.blender.org/api/current/bpy.types.ToolSettings.html#bpy.types.ToolSettings.mesh_select_mode

$\endgroup$
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .