1 # SPDX-FileCopyrightText: 2019-2022 Blender Foundation
3 # SPDX-License-Identifier: GPL-2.0-or-later
5 # km_snap_utilities_modal_keymap = "Snap Utilities Modal Map"
7 km_tool_snap_utilities_line
= "3D View Tool: Edit Mesh, Make Line"
10 def km_mesh_snap_utilities_operators():
13 {"space_type": 'EMPTY', "region_type": 'WINDOW'},
15 ("mesh.snap_utilities_line", {"type": 'K', "value": 'PRESS'},
16 {"properties": [("wait_for_input", True)],
23 def km_snap_utilities_modal_map():
27 km_snap_utilities_modal_keymap,
28 {"space_type": 'EMPTY', "region_type": 'WINDOW', "modal": True, "modal_enum": modal_enum},
33 ("ADD_CUT", "ADD_CUT", ""),
34 ("CANCEL", "CANCEL", ""),
35 ("CONFIRM", "CONFIRM", ""),
36 ("IGNORE_SNAP_ON", "IGNORE_SNAP_ON", ""),
37 ("IGNORE_SNAP_OFF", "IGNORE_SNAP_OFF", ""),
41 ("ADD_CUT", {"type": 'LEFTMOUSE', "value": 'ANY', "any": True}, None),
42 ("CANCEL", {"type": 'ESC', "value": 'PRESS', "any": True}, None),
43 ("CANCEL", {"type": 'LEFTMOUSE', "value": 'DOUBLE_CLICK', "any": True}, None),
44 ("CANCEL", {"type": 'RIGHTMOUSE', "value": 'PRESS', "any": True}, None),
45 ("CONFIRM", {"type": 'RET', "value": 'PRESS', "any": True}, None),
46 ("CONFIRM", {"type": 'NUMPAD_ENTER', "value": 'PRESS', "any": True}, None),
47 ("CONFIRM", {"type": 'SPACE', "value": 'PRESS', "any": True}, None),
48 ("IGNORE_SNAP_ON", {"type": 'LEFT_SHIFT', "value": 'PRESS', "any": True}, None),
49 ("IGNORE_SNAP_OFF", {"type": 'LEFT_SHIFT', "value": 'RELEASE', "any": True}, None),
50 ("IGNORE_SNAP_ON", {"type": 'RIGHT_SHIFT', "value": 'PRESS', "any": True}, None),
51 ("IGNORE_SNAP_OFF", {"type": 'RIGHT_SHIFT', "value": 'RELEASE', "any": True}, None),
58 def km_3d_view_tool_snap_utilities_line(tool_mouse
):
60 km_tool_snap_utilities_line
,
61 {"space_type": 'VIEW_3D', "region_type": 'WINDOW'},
63 ("mesh.snap_utilities_line", {"type": tool_mouse
, "value": 'PRESS'},
64 {"properties": [("wait_for_input", False)]}),
69 def km_view3d_empty(km_name
):
72 {"space_type": 'VIEW_3D', "region_type": 'WINDOW'},
76 # ------------------------------------------------------------------------------
80 def generate_empty_snap_utilities_tools_keymaps():
82 # km_view3d_empty(km_snap_utilities_modal_keymap),
84 km_view3d_empty(km_tool_snap_utilities_line
),
88 def generate_snap_utilities_global_keymaps(tool_mouse
='LEFTMOUSE'):
90 km_mesh_snap_utilities_operators(),
94 def generate_snap_utilities_tools_keymaps(tool_mouse
='LEFTMOUSE'):
97 km_3d_view_tool_snap_utilities_line(tool_mouse
),
101 def generate_snap_utilities_keymaps(tool_mouse
='LEFTMOUSE'):
103 km_mesh_snap_utilities_operators(),
106 # km_snap_utilities_modal_map(),
109 km_3d_view_tool_snap_utilities_line(tool_mouse
),