Merge branch 'master' into blender2.8
[blender.git] / source / blender / editors / armature / armature_ops.c
1 /*
2  * ***** BEGIN GPL LICENSE BLOCK *****
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software Foundation,
16  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17  *
18  * The Original Code is Copyright (C) 2009 Blender Foundation.
19  * All rights reserved.
20  *
21  *
22  * Contributor(s): Blender Foundation
23  *
24  * ***** END GPL LICENSE BLOCK *****
25  */
26
27 /** \file blender/editors/armature/armature_ops.c
28  *  \ingroup edarmature
29  */
30
31 #include "RNA_access.h"
32
33 #include "WM_api.h"
34 #include "WM_types.h"
35
36 #include "ED_armature.h"
37 #include "ED_screen.h"
38 #include "ED_transform.h"
39
40 #include "armature_intern.h"
41
42 /* ************************** registration **********************************/
43
44 /* Both operators ARMATURE_OT_xxx and POSE_OT_xxx here */
45 void ED_operatortypes_armature(void)
46 {
47         /* EDIT ARMATURE */
48         WM_operatortype_append(ARMATURE_OT_bone_primitive_add);
49
50         WM_operatortype_append(ARMATURE_OT_align);
51         WM_operatortype_append(ARMATURE_OT_calculate_roll);
52         WM_operatortype_append(ARMATURE_OT_roll_clear);
53         WM_operatortype_append(ARMATURE_OT_switch_direction);
54         WM_operatortype_append(ARMATURE_OT_subdivide);
55
56         WM_operatortype_append(ARMATURE_OT_parent_set);
57         WM_operatortype_append(ARMATURE_OT_parent_clear);
58
59         WM_operatortype_append(ARMATURE_OT_select_all);
60         WM_operatortype_append(ARMATURE_OT_select_mirror);
61         WM_operatortype_append(ARMATURE_OT_select_more);
62         WM_operatortype_append(ARMATURE_OT_select_less);
63         WM_operatortype_append(ARMATURE_OT_select_hierarchy);
64         WM_operatortype_append(ARMATURE_OT_select_linked);
65         WM_operatortype_append(ARMATURE_OT_select_similar);
66         WM_operatortype_append(ARMATURE_OT_shortest_path_pick);
67
68         WM_operatortype_append(ARMATURE_OT_delete);
69         WM_operatortype_append(ARMATURE_OT_dissolve);
70         WM_operatortype_append(ARMATURE_OT_duplicate);
71         WM_operatortype_append(ARMATURE_OT_symmetrize);
72         WM_operatortype_append(ARMATURE_OT_extrude);
73         WM_operatortype_append(ARMATURE_OT_hide);
74         WM_operatortype_append(ARMATURE_OT_reveal);
75         WM_operatortype_append(ARMATURE_OT_click_extrude);
76         WM_operatortype_append(ARMATURE_OT_fill);
77         WM_operatortype_append(ARMATURE_OT_merge);
78         WM_operatortype_append(ARMATURE_OT_separate);
79         WM_operatortype_append(ARMATURE_OT_split);
80
81         WM_operatortype_append(ARMATURE_OT_autoside_names);
82         WM_operatortype_append(ARMATURE_OT_flip_names);
83
84         WM_operatortype_append(ARMATURE_OT_layers_show_all);
85         WM_operatortype_append(ARMATURE_OT_armature_layers);
86         WM_operatortype_append(ARMATURE_OT_bone_layers);
87
88         /* POSE */
89         WM_operatortype_append(POSE_OT_hide);
90         WM_operatortype_append(POSE_OT_reveal);
91
92         WM_operatortype_append(POSE_OT_armature_apply);
93         WM_operatortype_append(POSE_OT_visual_transform_apply);
94
95         WM_operatortype_append(POSE_OT_rot_clear);
96         WM_operatortype_append(POSE_OT_loc_clear);
97         WM_operatortype_append(POSE_OT_scale_clear);
98         WM_operatortype_append(POSE_OT_transforms_clear);
99         WM_operatortype_append(POSE_OT_user_transforms_clear);
100
101         WM_operatortype_append(POSE_OT_copy);
102         WM_operatortype_append(POSE_OT_paste);
103
104         WM_operatortype_append(POSE_OT_select_all);
105
106         WM_operatortype_append(POSE_OT_select_parent);
107         WM_operatortype_append(POSE_OT_select_hierarchy);
108         WM_operatortype_append(POSE_OT_select_linked);
109         WM_operatortype_append(POSE_OT_select_constraint_target);
110         WM_operatortype_append(POSE_OT_select_grouped);
111         WM_operatortype_append(POSE_OT_select_mirror);
112
113         WM_operatortype_append(POSE_OT_group_add);
114         WM_operatortype_append(POSE_OT_group_remove);
115         WM_operatortype_append(POSE_OT_group_move);
116         WM_operatortype_append(POSE_OT_group_sort);
117         WM_operatortype_append(POSE_OT_group_assign);
118         WM_operatortype_append(POSE_OT_group_unassign);
119         WM_operatortype_append(POSE_OT_group_select);
120         WM_operatortype_append(POSE_OT_group_deselect);
121
122         WM_operatortype_append(POSE_OT_paths_calculate);
123         WM_operatortype_append(POSE_OT_paths_update);
124         WM_operatortype_append(POSE_OT_paths_clear);
125
126         WM_operatortype_append(POSE_OT_autoside_names);
127         WM_operatortype_append(POSE_OT_flip_names);
128
129         WM_operatortype_append(POSE_OT_rotation_mode_set);
130
131         WM_operatortype_append(POSE_OT_quaternions_flip);
132
133         WM_operatortype_append(POSE_OT_bone_layers);
134
135         WM_operatortype_append(POSE_OT_toggle_bone_selection_overlay);
136
137         WM_operatortype_append(POSE_OT_propagate);
138
139         /* POSELIB */
140         WM_operatortype_append(POSELIB_OT_browse_interactive);
141         WM_operatortype_append(POSELIB_OT_apply_pose);
142
143         WM_operatortype_append(POSELIB_OT_pose_add);
144         WM_operatortype_append(POSELIB_OT_pose_remove);
145         WM_operatortype_append(POSELIB_OT_pose_rename);
146         WM_operatortype_append(POSELIB_OT_pose_move);
147
148         WM_operatortype_append(POSELIB_OT_new);
149         WM_operatortype_append(POSELIB_OT_unlink);
150
151         WM_operatortype_append(POSELIB_OT_action_sanitize);
152
153         /* POSE SLIDING */
154         WM_operatortype_append(POSE_OT_push);
155         WM_operatortype_append(POSE_OT_relax);
156         WM_operatortype_append(POSE_OT_breakdown);
157 }
158
159 void ED_operatormacros_armature(void)
160 {
161         wmOperatorType *ot;
162         wmOperatorTypeMacro *otmacro;
163
164         ot = WM_operatortype_append_macro("ARMATURE_OT_duplicate_move", "Duplicate",
165                                           "Make copies of the selected bones within the same armature and move them",
166                                           OPTYPE_UNDO | OPTYPE_REGISTER);
167         WM_operatortype_macro_define(ot, "ARMATURE_OT_duplicate");
168         otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
169         RNA_enum_set(otmacro->ptr, "proportional", 0);
170
171         ot = WM_operatortype_append_macro("ARMATURE_OT_extrude_move", "Extrude",
172                                           "Create new bones from the selected joints and move them",
173                                           OPTYPE_UNDO | OPTYPE_REGISTER);
174         otmacro = WM_operatortype_macro_define(ot, "ARMATURE_OT_extrude");
175         RNA_boolean_set(otmacro->ptr, "forked", false);
176         otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
177         RNA_enum_set(otmacro->ptr, "proportional", 0);
178
179         /* XXX would it be nicer to just be able to have standard extrude_move, but set the forked property separate?
180          * that would require fixing a properties bug 19733 */
181         ot = WM_operatortype_append_macro("ARMATURE_OT_extrude_forked", "Extrude Forked",
182                                           "Create new bones from the selected joints and move them",
183                                           OPTYPE_UNDO | OPTYPE_REGISTER);
184         otmacro = WM_operatortype_macro_define(ot, "ARMATURE_OT_extrude");
185         RNA_boolean_set(otmacro->ptr, "forked", true);
186         otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
187         RNA_enum_set(otmacro->ptr, "proportional", 0);
188 }
189
190 void ED_keymap_armature(wmKeyConfig *keyconf)
191 {
192         wmKeyMap *keymap;
193         wmKeyMapItem *kmi;
194
195         /* Armature ------------------------ */
196         keymap = WM_keymap_find(keyconf, "Armature", 0, 0);
197         keymap->poll = ED_operator_editarmature;
198
199         /* only set in editmode armature, by space_view3d listener */
200         kmi = WM_keymap_add_item(keymap, "ARMATURE_OT_hide", HKEY, KM_PRESS, 0, 0);
201         RNA_boolean_set(kmi->ptr, "unselected", false);
202         kmi = WM_keymap_add_item(keymap, "ARMATURE_OT_hide", HKEY, KM_PRESS, KM_SHIFT, 0);
203         RNA_boolean_set(kmi->ptr, "unselected", true);
204
205         WM_keymap_add_item(keymap, "ARMATURE_OT_reveal", HKEY, KM_PRESS, KM_ALT, 0);
206         WM_keymap_add_item(keymap, "ARMATURE_OT_align", AKEY, KM_PRESS, KM_CTRL | KM_ALT, 0);
207         WM_keymap_add_item(keymap, "ARMATURE_OT_calculate_roll", NKEY, KM_PRESS, KM_CTRL, 0);
208         WM_keymap_add_item(keymap, "ARMATURE_OT_roll_clear", RKEY, KM_PRESS, KM_ALT, 0);
209
210         WM_keymap_add_item(keymap, "ARMATURE_OT_switch_direction", FKEY, KM_PRESS, KM_ALT, 0);
211
212         WM_keymap_add_item(keymap, "ARMATURE_OT_bone_primitive_add", AKEY, KM_PRESS, KM_SHIFT, 0);
213
214         WM_keymap_add_item(keymap, "ARMATURE_OT_parent_set", PKEY, KM_PRESS, KM_CTRL, 0);
215         WM_keymap_add_item(keymap, "ARMATURE_OT_parent_clear", PKEY, KM_PRESS, KM_ALT, 0);
216
217         kmi = WM_keymap_add_item(keymap, "ARMATURE_OT_select_all", AKEY, KM_PRESS, 0, 0);
218         RNA_enum_set(kmi->ptr, "action", SEL_TOGGLE);
219         kmi = WM_keymap_add_item(keymap, "ARMATURE_OT_select_all", IKEY, KM_PRESS, KM_CTRL, 0);
220         RNA_enum_set(kmi->ptr, "action", SEL_INVERT);
221
222         kmi = WM_keymap_add_item(keymap, "ARMATURE_OT_select_mirror", MKEY, KM_PRESS, KM_CTRL | KM_SHIFT, 0);
223         RNA_boolean_set(kmi->ptr, "extend", false);
224
225         kmi = WM_keymap_add_item(keymap, "ARMATURE_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, 0, 0);
226         RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_PARENT);
227         RNA_boolean_set(kmi->ptr, "extend", false);
228         kmi = WM_keymap_add_item(keymap, "ARMATURE_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, KM_SHIFT, 0);
229         RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_PARENT);
230         RNA_boolean_set(kmi->ptr, "extend", true);
231
232         kmi = WM_keymap_add_item(keymap, "ARMATURE_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, 0, 0);
233         RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_CHILD);
234         RNA_boolean_set(kmi->ptr, "extend", false);
235         kmi = WM_keymap_add_item(keymap, "ARMATURE_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, KM_SHIFT, 0);
236         RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_CHILD);
237         RNA_boolean_set(kmi->ptr, "extend", true);
238
239         WM_keymap_add_item(keymap, "ARMATURE_OT_select_more", PADPLUSKEY, KM_PRESS, KM_CTRL, 0);
240         WM_keymap_add_item(keymap, "ARMATURE_OT_select_less", PADMINUS, KM_PRESS, KM_CTRL, 0);
241
242         WM_keymap_add_item(keymap, "ARMATURE_OT_select_similar", GKEY, KM_PRESS, KM_SHIFT, 0);
243
244         WM_keymap_add_item(keymap, "ARMATURE_OT_select_linked", LKEY, KM_PRESS, 0, 0);
245
246         WM_keymap_add_item(keymap, "ARMATURE_OT_shortest_path_pick", SELECTMOUSE, KM_PRESS, KM_CTRL, 0);
247
248         WM_keymap_add_menu(keymap, "VIEW3D_MT_edit_armature_delete", XKEY, KM_PRESS, 0, 0);
249         WM_keymap_add_menu(keymap, "VIEW3D_MT_edit_armature_delete", DELKEY, KM_PRESS, 0, 0);
250         WM_keymap_add_item(keymap, "ARMATURE_OT_dissolve", XKEY, KM_PRESS, KM_CTRL, 0);
251         WM_keymap_add_item(keymap, "ARMATURE_OT_duplicate_move", DKEY, KM_PRESS, KM_SHIFT, 0);
252         WM_keymap_add_item(keymap, "ARMATURE_OT_extrude_move", EKEY, KM_PRESS, 0, 0);
253         WM_keymap_add_item(keymap, "ARMATURE_OT_extrude_forked", EKEY, KM_PRESS, KM_SHIFT, 0);
254         WM_keymap_add_item(keymap, "ARMATURE_OT_click_extrude", ACTIONMOUSE, KM_CLICK, KM_CTRL, 0);
255         WM_keymap_add_item(keymap, "ARMATURE_OT_fill", FKEY, KM_PRESS, 0, 0);
256         WM_keymap_add_item(keymap, "ARMATURE_OT_merge", MKEY, KM_PRESS, KM_ALT, 0);
257         WM_keymap_add_item(keymap, "ARMATURE_OT_split", YKEY, KM_PRESS, 0, 0);
258
259         WM_keymap_add_item(keymap, "ARMATURE_OT_separate", PKEY, KM_PRESS, 0, 0);
260
261         /* set flags */
262         WM_keymap_add_menu(keymap, "VIEW3D_MT_bone_options_toggle", WKEY, KM_PRESS, KM_SHIFT, 0);
263         WM_keymap_add_menu(keymap, "VIEW3D_MT_bone_options_enable", WKEY, KM_PRESS, KM_CTRL | KM_SHIFT, 0);
264         WM_keymap_add_menu(keymap, "VIEW3D_MT_bone_options_disable", WKEY, KM_PRESS, KM_ALT, 0);
265
266         /* armature/bone layers */
267         WM_keymap_add_item(keymap, "ARMATURE_OT_layers_show_all", ACCENTGRAVEKEY, KM_PRESS, KM_CTRL, 0);
268         WM_keymap_add_item(keymap, "ARMATURE_OT_armature_layers", MKEY, KM_PRESS, KM_SHIFT, 0);
269         WM_keymap_add_item(keymap, "ARMATURE_OT_bone_layers", MKEY, KM_PRESS, 0, 0);
270
271         /* special transforms: */
272         /*  1) envelope/b-bone size */
273         kmi = WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", SKEY, KM_PRESS, KM_CTRL | KM_ALT, 0);
274         RNA_enum_set(kmi->ptr, "mode", TFM_BONESIZE);
275         /*  2) envelope radius */
276         kmi = WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", SKEY, KM_PRESS, KM_ALT, 0);
277         RNA_enum_set(kmi->ptr, "mode", TFM_BONE_ENVELOPE);
278         /*  3) set roll */
279         kmi = WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", RKEY, KM_PRESS, KM_CTRL, 0);
280         RNA_enum_set(kmi->ptr, "mode", TFM_BONE_ROLL);
281
282         /* menus */
283         WM_keymap_add_menu(keymap, "VIEW3D_MT_armature_specials", WKEY, KM_PRESS, 0, 0);
284
285         /* Pose ------------------------ */
286         /* only set in posemode, by space_view3d listener */
287         keymap = WM_keymap_find(keyconf, "Pose", 0, 0);
288         keymap->poll = ED_operator_posemode;
289
290         /* set parent and add object are object-based operators, but we make them
291          * available here because it's useful to do in pose mode too */
292         WM_keymap_add_item(keymap, "OBJECT_OT_parent_set", PKEY, KM_PRESS, KM_CTRL, 0);
293         WM_keymap_add_menu(keymap, "INFO_MT_add", AKEY, KM_PRESS, KM_SHIFT, 0);
294
295         kmi = WM_keymap_add_item(keymap, "POSE_OT_hide", HKEY, KM_PRESS, 0, 0);
296         RNA_boolean_set(kmi->ptr, "unselected", false);
297         kmi = WM_keymap_add_item(keymap, "POSE_OT_hide", HKEY, KM_PRESS, KM_SHIFT, 0);
298         RNA_boolean_set(kmi->ptr, "unselected", true);
299
300         WM_keymap_add_item(keymap, "POSE_OT_reveal", HKEY, KM_PRESS, KM_ALT, 0);
301
302         WM_keymap_add_menu(keymap, "VIEW3D_MT_pose_apply", AKEY, KM_PRESS, KM_CTRL, 0);
303
304         /* TODO: clear pose */
305         WM_keymap_add_item(keymap, "POSE_OT_rot_clear", RKEY, KM_PRESS, KM_ALT, 0);
306         WM_keymap_add_item(keymap, "POSE_OT_loc_clear", GKEY, KM_PRESS, KM_ALT, 0);
307         WM_keymap_add_item(keymap, "POSE_OT_scale_clear", SKEY, KM_PRESS, KM_ALT, 0);
308
309         WM_keymap_add_item(keymap, "POSE_OT_quaternions_flip", FKEY, KM_PRESS, KM_ALT, 0);
310
311         WM_keymap_add_item(keymap, "POSE_OT_rotation_mode_set", RKEY, KM_PRESS, KM_CTRL, 0);
312
313         WM_keymap_add_item(keymap, "POSE_OT_copy", CKEY, KM_PRESS, KM_CTRL, 0);
314         kmi = WM_keymap_add_item(keymap, "POSE_OT_paste", VKEY, KM_PRESS, KM_CTRL, 0);
315         RNA_boolean_set(kmi->ptr, "flipped", false);
316         kmi = WM_keymap_add_item(keymap, "POSE_OT_paste", VKEY, KM_PRESS, KM_CTRL | KM_SHIFT, 0);
317         RNA_boolean_set(kmi->ptr, "flipped", true);
318
319 #ifdef __APPLE__
320         WM_keymap_add_item(keymap, "POSE_OT_copy", CKEY, KM_PRESS, KM_OSKEY, 0);
321         kmi = WM_keymap_add_item(keymap, "POSE_OT_paste", VKEY, KM_PRESS, KM_OSKEY, 0);
322         RNA_boolean_set(kmi->ptr, "flipped", false);
323         kmi = WM_keymap_add_item(keymap, "POSE_OT_paste", VKEY, KM_PRESS, KM_OSKEY | KM_SHIFT, 0);
324         RNA_boolean_set(kmi->ptr, "flipped", true);
325 #endif
326
327         kmi = WM_keymap_add_item(keymap, "POSE_OT_select_all", AKEY, KM_PRESS, 0, 0);
328         RNA_enum_set(kmi->ptr, "action", SEL_TOGGLE);
329         kmi = WM_keymap_add_item(keymap, "POSE_OT_select_all", IKEY, KM_PRESS, KM_CTRL, 0);
330         RNA_enum_set(kmi->ptr, "action", SEL_INVERT);
331
332         WM_keymap_add_item(keymap, "POSE_OT_select_parent", PKEY, KM_PRESS, KM_SHIFT, 0);
333
334         kmi = WM_keymap_add_item(keymap, "POSE_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, 0, 0);
335         RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_PARENT);
336         RNA_boolean_set(kmi->ptr, "extend", false);
337         kmi = WM_keymap_add_item(keymap, "POSE_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, KM_SHIFT, 0);
338         RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_PARENT);
339         RNA_boolean_set(kmi->ptr, "extend", true);
340
341         kmi = WM_keymap_add_item(keymap, "POSE_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, 0, 0);
342         RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_CHILD);
343         RNA_boolean_set(kmi->ptr, "extend", false);
344         kmi = WM_keymap_add_item(keymap, "POSE_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, KM_SHIFT, 0);
345         RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_CHILD);
346         RNA_boolean_set(kmi->ptr, "extend", true);
347
348         WM_keymap_add_item(keymap, "POSE_OT_select_linked", LKEY, KM_PRESS, 0, 0);
349         WM_keymap_add_item(keymap, "POSE_OT_select_grouped", GKEY, KM_PRESS, KM_SHIFT, 0);
350         WM_keymap_add_item(keymap, "POSE_OT_select_mirror", FKEY, KM_PRESS, KM_SHIFT | KM_CTRL, 0);
351
352         WM_keymap_add_item(keymap, "POSE_OT_constraint_add_with_targets", CKEY, KM_PRESS, KM_CTRL | KM_SHIFT, 0);
353         WM_keymap_add_item(keymap, "POSE_OT_constraints_clear", CKEY, KM_PRESS, KM_CTRL | KM_ALT, 0);
354         WM_keymap_add_item(keymap, "POSE_OT_ik_add", IKEY, KM_PRESS, /*KM_CTRL|*/ KM_SHIFT, 0);
355         WM_keymap_add_item(keymap, "POSE_OT_ik_clear", IKEY, KM_PRESS, KM_CTRL | KM_ALT, 0);
356
357         WM_keymap_add_menu(keymap, "VIEW3D_MT_pose_group", GKEY, KM_PRESS, KM_CTRL, 0);
358
359         /* set flags */
360         WM_keymap_add_menu(keymap, "VIEW3D_MT_bone_options_toggle", WKEY, KM_PRESS, KM_SHIFT, 0);
361         WM_keymap_add_menu(keymap, "VIEW3D_MT_bone_options_enable", WKEY, KM_PRESS, KM_CTRL | KM_SHIFT, 0);
362         WM_keymap_add_menu(keymap, "VIEW3D_MT_bone_options_disable", WKEY, KM_PRESS, KM_ALT, 0);
363
364         /* armature/bone layers */
365         WM_keymap_add_item(keymap, "ARMATURE_OT_layers_show_all", ACCENTGRAVEKEY, KM_PRESS, KM_CTRL, 0);
366         WM_keymap_add_item(keymap, "ARMATURE_OT_armature_layers", MKEY, KM_PRESS, KM_SHIFT, 0);
367         WM_keymap_add_item(keymap, "POSE_OT_bone_layers", MKEY, KM_PRESS, 0, 0);
368         WM_keymap_add_item(keymap, "POSE_OT_toggle_bone_selection_overlay", ZKEY, KM_PRESS, 0, 0);
369
370         /* special transforms: */
371         /*  1) envelope/b-bone size */
372         kmi = WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", SKEY, KM_PRESS, KM_CTRL | KM_ALT, 0);
373         RNA_enum_set(kmi->ptr, "mode", TFM_BONESIZE);
374
375         /* keyframes management */
376         WM_keymap_verify_item(keymap, "ANIM_OT_keyframe_insert_menu", IKEY, KM_PRESS, 0, 0);
377         WM_keymap_verify_item(keymap, "ANIM_OT_keyframe_delete_v3d", IKEY, KM_PRESS, KM_ALT, 0);
378         WM_keymap_verify_item(keymap, "ANIM_OT_keying_set_active_set", IKEY, KM_PRESS, KM_CTRL | KM_SHIFT | KM_ALT, 0);
379
380         /* Pose -> PoseLib ------------- */
381         /* only set in posemode, by space_view3d listener */
382         WM_keymap_add_item(keymap, "POSELIB_OT_browse_interactive", LKEY, KM_PRESS, KM_CTRL, 0);
383
384         WM_keymap_add_item(keymap, "POSELIB_OT_pose_add", LKEY, KM_PRESS, KM_SHIFT, 0);
385         WM_keymap_add_item(keymap, "POSELIB_OT_pose_remove", LKEY, KM_PRESS, KM_ALT, 0);
386         WM_keymap_add_item(keymap, "POSELIB_OT_pose_rename", LKEY, KM_PRESS, KM_CTRL | KM_SHIFT, 0);
387
388         /* Pose -> Pose Sliding ------------- */
389         /* only set in posemode, by space_view3d listener */
390         WM_keymap_add_item(keymap, "POSE_OT_push", EKEY, KM_PRESS, KM_CTRL, 0);
391         WM_keymap_add_item(keymap, "POSE_OT_relax", EKEY, KM_PRESS, KM_ALT, 0);
392         WM_keymap_add_item(keymap, "POSE_OT_breakdown", EKEY, KM_PRESS, KM_SHIFT, 0);
393
394         /* menus */
395         WM_keymap_add_menu(keymap, "VIEW3D_MT_pose_specials", WKEY, KM_PRESS, 0, 0);
396         WM_keymap_add_menu(keymap, "VIEW3D_MT_pose_propagate", PKEY, KM_PRESS, KM_ALT, 0);
397 }
398