2
$\begingroup$

I would like to create or change the hotkeys for the vertex select, edge select, and face select options. I know that they already have Ctrl+Tab+1, 2, and 3, but I don't like using them. They are a pain to use. I would like to change it to Alt+1, 2, and 3. I know you can use the python script to do a lot of these things but I don't really know how to set that up.

Is there a way to make these changes?

$\endgroup$

1 Answer 1

3
$\begingroup$

Can use the window manager context setting operators. The property that needs changing is

scene.tool_settings.mesh_select_mode

which is a 3 member collection. All modes (True, True, True), just verts (True, False, False). To set verts alonr mesh_select_mode[0] = True.

To set them individually, set vert select mode on. Leaves faces and edge mode as is.

bpy.ops.wm.context_set_boolean(
        data_path="scene.tool_settings.mesh_select_mode[0]", 
        value=True)

to toggle

bpy.ops.wm.context_toggle(
        data_path="scene.tool_settings.mesh_select_mode[0]")

To set the mode to vert only

bpy.ops.wm.context_set_value(
        data_path="scene.tool_settings.mesh_select_mode", 
        value="(True, False, False)")

or mesh.select_mode with no extend selection and vert type.

bpy.ops.mesh.select_mode(use_extend=False, 
        use_expand=False, 
        type='VERT')

Ok that looks good, add to 3Dview, mesh shortcuts.

enter image description here Setup with wm.context_set_value

now Alt+1 will set to vert mode.

$\endgroup$

You must log in to answer this question.

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