Import_3ds: Improved distance cue chunk import
[blender-addons.git] / mesh_snap_utilities_line / keys.py
blobe751492debbfa14314ceedf4f2d7c15062edb19c
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():
11 return (
12 "Mesh",
13 {"space_type": 'EMPTY', "region_type": 'WINDOW'},
14 {"items": [
15 ("mesh.snap_utilities_line", {"type": 'K', "value": 'PRESS'},
16 {"properties": [("wait_for_input", True)],
17 "active":False}),
18 ]},
22 """
23 def km_snap_utilities_modal_map():
24 items = []
25 modal_enum = []
26 keymap = (
27 km_snap_utilities_modal_keymap,
28 {"space_type": 'EMPTY', "region_type": 'WINDOW', "modal": True, "modal_enum": modal_enum},
29 {"items": items},
32 modal_enum.extend([
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", ""),
40 items.extend([
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),
54 return keymap
55 """
58 def km_3d_view_tool_snap_utilities_line(tool_mouse):
59 return (
60 km_tool_snap_utilities_line,
61 {"space_type": 'VIEW_3D', "region_type": 'WINDOW'},
62 {"items": [
63 ("mesh.snap_utilities_line", {"type": tool_mouse, "value": 'PRESS'},
64 {"properties": [("wait_for_input", False)]}),
65 ]},
69 def km_view3d_empty(km_name):
70 return (
71 km_name,
72 {"space_type": 'VIEW_3D', "region_type": 'WINDOW'},
73 {"items": []},
76 # ------------------------------------------------------------------------------
77 # Full Configuration
80 def generate_empty_snap_utilities_tools_keymaps():
81 return [
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'):
89 return [
90 km_mesh_snap_utilities_operators(),
94 def generate_snap_utilities_tools_keymaps(tool_mouse='LEFTMOUSE'):
95 return [
96 # Tool System.
97 km_3d_view_tool_snap_utilities_line(tool_mouse),
101 def generate_snap_utilities_keymaps(tool_mouse='LEFTMOUSE'):
102 return [
103 km_mesh_snap_utilities_operators(),
105 # Modal maps.
106 # km_snap_utilities_modal_map(),
108 # Tool System.
109 km_3d_view_tool_snap_utilities_line(tool_mouse),