-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathkeymap.py
262 lines (224 loc) · 11.3 KB
/
keymap.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
import bpy
addon_keymaps = []
def register():
# handle the keymap
wm = bpy.context.window_manager
kc = wm.keyconfigs.addon
if kc:
# BASIC KEYMAP
km = wm.keyconfigs.addon.keymaps.new(
name='Abnormal', space_type='EMPTY')
# SELECTION KEYMAP
if True:
km.keymap_items.new('New Click Selection',
'RIGHTMOUSE', 'PRESS')
km.keymap_items.new('Add Click Selection',
'RIGHTMOUSE', 'PRESS', shift=True)
km.keymap_items.new('New Loop Selection',
'RIGHTMOUSE', 'PRESS', alt=True)
km.keymap_items.new('Add Loop Selection', 'RIGHTMOUSE',
'PRESS', alt=True, shift=True)
km.keymap_items.new('New Shortest Path Selection',
'RIGHTMOUSE', 'PRESS', ctrl=True)
km.keymap_items.new('Add Shortest Path Selection', 'RIGHTMOUSE',
'PRESS', ctrl=True, shift=True)
km.keymap_items.new('Invert Selection',
'I', 'PRESS')
km.keymap_items.new('Select Linked',
'L', 'PRESS', ctrl=True)
km.keymap_items.new('Select Hover Linked',
'L', 'PRESS')
km.keymap_items.new('Select All',
'A', 'PRESS')
km.keymap_items.new('Deselect All',
'A', 'PRESS', alt=True)
km.keymap_items.new('Box Select Start',
'B', 'PRESS')
km.keymap_items.new('Box Select Start Selection',
'LEFTMOUSE', 'PRESS', any=True)
km.keymap_items.new('Box New Selection',
'LEFTMOUSE', 'RELEASE', any=True)
km.keymap_items.new('Box Add Selection',
'LEFTMOUSE', 'RELEASE', shift=True)
km.keymap_items.new('Box Remove Selection',
'LEFTMOUSE', 'RELEASE', ctrl=True)
km.keymap_items.new('Lasso Select Start',
'V', 'PRESS')
km.keymap_items.new('Lasso Select Start Selection',
'LEFTMOUSE', 'PRESS', any=True)
km.keymap_items.new('Lasso New Selection',
'LEFTMOUSE', 'RELEASE', any=True)
km.keymap_items.new('Lasso Add Selection',
'LEFTMOUSE', 'RELEASE', shift=True)
km.keymap_items.new('Lasso Remove Selection',
'LEFTMOUSE', 'RELEASE', ctrl=True)
km.keymap_items.new('Circle Select Start',
'C', 'PRESS')
km.keymap_items.new('Circle Select Start Selection',
'LEFTMOUSE', 'PRESS', any=True)
km.keymap_items.new('Circle End Selection',
'LEFTMOUSE', 'RELEASE', any=True)
km.keymap_items.new('Circle Add Selection',
'LEFTMOUSE', 'PRESS')
km.keymap_items.new('Circle Remove Selection',
'LEFTMOUSE', 'PRESS', ctrl=True)
km.keymap_items.new('Circle Increase Size 1',
'RIGHT_BRACKET', 'PRESS')
km.keymap_items.new('Circle Increase Size 2',
'WHEELUPMOUSE', 'PRESS', alt=True)
km.keymap_items.new('Circle Decrease Size 1',
'LEFT_BRACKET', 'PRESS')
km.keymap_items.new('Circle Decrease Size 2',
'WHEELDOWNMOUSE', 'PRESS', alt=True)
km.keymap_items.new('Circle Resize Mode Start',
'F', 'PRESS')
km.keymap_items.new('Circle Resize Confirm',
'F', 'RELEASE', any=True)
# SHORTCUTS KEYMAP
if True:
km.keymap_items.new('Rotate Normals',
'R', 'PRESS')
km.keymap_items.new('Toggle X-Ray',
'Z', 'PRESS')
km.keymap_items.new('Hide Unselected',
'H', 'PRESS', shift=True)
km.keymap_items.new('Hide Selected',
'H', 'PRESS')
km.keymap_items.new('Unhide',
'H', 'PRESS', alt=True)
km.keymap_items.new('Reset Gizmo Rotation',
'R', 'PRESS', alt=True)
km.keymap_items.new('Toggle Gizmo',
'G', 'PRESS')
km.keymap_items.new('Mirror Normals Start',
'M', 'PRESS')
km.keymap_items.new('Mirror Normals X',
'X', 'PRESS')
km.keymap_items.new('Mirror Normals Y',
'Y', 'PRESS')
km.keymap_items.new('Mirror Normals Z',
'Z', 'PRESS')
km.keymap_items.new('Smooth Normals',
'S', 'PRESS')
km.keymap_items.new('Flatten Normals Start',
'F', 'PRESS')
km.keymap_items.new('Flatten Normals X',
'X', 'PRESS')
km.keymap_items.new('Flatten Normals Y',
'Y', 'PRESS')
km.keymap_items.new('Flatten Normals Z',
'Z', 'PRESS')
km.keymap_items.new('Align Normals Start',
'E', 'PRESS')
km.keymap_items.new('Align Normals Pos X',
'X', 'PRESS')
km.keymap_items.new('Align Normals Pos Y',
'Y', 'PRESS')
km.keymap_items.new('Align Normals Pos Z',
'Z', 'PRESS')
km.keymap_items.new('Align Normals Neg X',
'X', 'PRESS', shift=True)
km.keymap_items.new('Align Normals Neg Y',
'Y', 'PRESS', shift=True)
km.keymap_items.new('Align Normals Neg Z',
'Z', 'PRESS', shift=True)
km.keymap_items.new('Copy Active Normal',
'C', 'PRESS', ctrl=True)
km.keymap_items.new('Paste Stored Normal',
'V', 'PRESS', ctrl=True)
km.keymap_items.new('Paste Active Normal to Selected',
'V', 'PRESS', shift=True, ctrl=True)
km.keymap_items.new('Set Normals Outside',
'N', 'PRESS', shift=True)
km.keymap_items.new('Set Normals Inside', 'N',
'PRESS', shift=True, ctrl=True)
km.keymap_items.new('Flip Normals',
'R', 'PRESS', shift=True)
km.keymap_items.new('Reset Vectors',
'R', 'PRESS', ctrl=True)
km.keymap_items.new('Set Normals From Faces',
'F', 'PRESS', ctrl=True)
km.keymap_items.new('Average Individual Normals',
'Q', 'PRESS')
km.keymap_items.new('Average Selected Normals',
'W', 'PRESS')
km.keymap_items.new('Cancel Modal',
'ESC', 'PRESS')
km.keymap_items.new('Confirm Modal',
'TAB', 'PRESS')
km.keymap_items.new('History Undo',
'Z', 'PRESS', ctrl=True)
km.keymap_items.new('History Redo',
'Z', 'PRESS', ctrl=True, shift=True)
# TOOLS KEYMAP
if True:
km.keymap_items.new('Rotate X Axis',
'X', 'PRESS')
km.keymap_items.new('Rotate Y Axis',
'Y', 'PRESS')
km.keymap_items.new('Rotate Z Axis',
'Z', 'PRESS')
km.keymap_items.new('Target Move Start',
'G', 'PRESS')
km.keymap_items.new('Target Center Reset',
'G', 'PRESS', alt=True)
km.keymap_items.new('Target Move X Axis',
'X', 'PRESS')
km.keymap_items.new('Target Move Y Axis',
'Y', 'PRESS')
km.keymap_items.new('Target Move Z Axis',
'Z', 'PRESS')
km.keymap_items.new('Filter Mask From Selected',
'G', 'PRESS', ctrl=True)
km.keymap_items.new('Clear Filter Mask',
'G', 'PRESS', alt=True)
#
km.keymap_items.new('Confirm Tool 1',
'LEFTMOUSE', 'PRESS', any=True)
km.keymap_items.new('Confirm Tool 2',
'RET', 'PRESS', any=True)
km.keymap_items.new('Confirm Tool 3',
'LEFTMOUSE', 'RELEASE', any=True)
km.keymap_items.new('Cancel Tool 1',
'ESC', 'PRESS', any=True)
km.keymap_items.new('Cancel Tool 2',
'RIGHTMOUSE', 'PRESS', any=True)
#
km.keymap_items.new('UI Click',
'LEFTMOUSE', 'PRESS')
km.keymap_items.new('UI Click',
'LEFTMOUSE', 'RELEASE')
km.keymap_items.new('UI Panel Scroll Up 1',
'WHEELDOWNMOUSE', 'PRESS')
km.keymap_items.new('UI Panel Scroll Up 2',
'WHEELOUTMOUSE', 'PRESS')
km.keymap_items.new('UI Panel Scroll Down 1',
'WHEELUPMOUSE', 'PRESS')
km.keymap_items.new('UI Panel Scroll Down 2',
'WHEELINMOUSE', 'PRESS')
km.keymap_items.new('Toggle Cyclic Status',
'F', 'PRESS')
km.keymap_items.new('Reset Point Rotate',
'R', 'PRESS', alt=True)
km.keymap_items.new('Reset Point Sharpness',
'S', 'PRESS', alt=True)
km.keymap_items.new('Point Rotate Start',
'R', 'PRESS')
km.keymap_items.new('Point Sharpness Start',
'S', 'PRESS')
km.keymap_items.new('Delete Selected Points',
'X', 'PRESS')
km.keymap_items.new('Pass Thru 1',
'LEFTMOUSE', 'PRESS', any=True)
km.keymap_items.new('Pass Thru 2',
'LEFTMOUSE', 'RELEASE', any=True)
km.keymap_items.new('Pass Thru 3',
'LEFTMOUSE', 'CLICK', any=True)
km.keymap_items.new('Pass Thru 4',
'N', 'PRESS')
addon_keymaps.append(km)
def unregister():
for km in addon_keymaps:
for i in range(len(km.keymap_items)):
km.keymap_items.remove(km.keymap_items[0])
addon_keymaps.clear()