style cleanup: mainly for mesh code, also some WM function use.
[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
32 #include <stdlib.h>
33 #include <math.h>
34
35 #include "BLO_sys_types.h"
36
37 #include "BLI_math.h"
38 #include "BLI_blenlib.h"
39
40
41 #include "RNA_access.h"
42
43 #include "WM_api.h"
44 #include "WM_types.h"
45
46 #include "ED_armature.h"
47 #include "ED_screen.h"
48 #include "ED_transform.h"
49
50 #include "armature_intern.h"
51
52 /* ************************** registration **********************************/
53
54 /* Both operators ARMATURE_OT_xxx and POSE_OT_xxx here */
55 void ED_operatortypes_armature(void)
56 {
57         /* EDIT ARMATURE */
58         WM_operatortype_append(ARMATURE_OT_bone_primitive_add);
59         
60         WM_operatortype_append(ARMATURE_OT_align);
61         WM_operatortype_append(ARMATURE_OT_calculate_roll);
62         WM_operatortype_append(ARMATURE_OT_switch_direction);
63         WM_operatortype_append(ARMATURE_OT_subdivide);
64         
65         WM_operatortype_append(ARMATURE_OT_parent_set);
66         WM_operatortype_append(ARMATURE_OT_parent_clear);
67         
68         WM_operatortype_append(ARMATURE_OT_select_all);
69         WM_operatortype_append(ARMATURE_OT_select_inverse);
70         WM_operatortype_append(ARMATURE_OT_select_hierarchy);
71         WM_operatortype_append(ARMATURE_OT_select_linked);
72
73         WM_operatortype_append(ARMATURE_OT_delete);
74         WM_operatortype_append(ARMATURE_OT_duplicate);
75         WM_operatortype_append(ARMATURE_OT_extrude);
76         WM_operatortype_append(ARMATURE_OT_hide);
77         WM_operatortype_append(ARMATURE_OT_reveal);
78         WM_operatortype_append(ARMATURE_OT_click_extrude);
79         WM_operatortype_append(ARMATURE_OT_fill);
80         WM_operatortype_append(ARMATURE_OT_merge);
81         WM_operatortype_append(ARMATURE_OT_separate);
82         
83         WM_operatortype_append(ARMATURE_OT_autoside_names);
84         WM_operatortype_append(ARMATURE_OT_flip_names);
85         
86         WM_operatortype_append(ARMATURE_OT_layers_show_all);
87         WM_operatortype_append(ARMATURE_OT_armature_layers);
88         WM_operatortype_append(ARMATURE_OT_bone_layers);
89
90         /* SKETCH */    
91         WM_operatortype_append(SKETCH_OT_gesture);
92         WM_operatortype_append(SKETCH_OT_delete);
93         WM_operatortype_append(SKETCH_OT_draw_stroke);
94         WM_operatortype_append(SKETCH_OT_draw_preview);
95         WM_operatortype_append(SKETCH_OT_finish_stroke);
96         WM_operatortype_append(SKETCH_OT_cancel_stroke);
97         WM_operatortype_append(SKETCH_OT_convert);
98         WM_operatortype_append(SKETCH_OT_select);
99
100         /* POSE */
101         WM_operatortype_append(POSE_OT_hide);
102         WM_operatortype_append(POSE_OT_reveal);
103         
104         WM_operatortype_append(POSE_OT_armature_apply);
105         WM_operatortype_append(POSE_OT_visual_transform_apply);
106         
107         WM_operatortype_append(POSE_OT_rot_clear);
108         WM_operatortype_append(POSE_OT_loc_clear);
109         WM_operatortype_append(POSE_OT_scale_clear);
110         WM_operatortype_append(POSE_OT_transforms_clear);
111         WM_operatortype_append(POSE_OT_user_transforms_clear);
112         
113         WM_operatortype_append(POSE_OT_copy);
114         WM_operatortype_append(POSE_OT_paste);
115         
116         WM_operatortype_append(POSE_OT_select_all);
117
118         WM_operatortype_append(POSE_OT_select_parent);
119         WM_operatortype_append(POSE_OT_select_hierarchy);
120         WM_operatortype_append(POSE_OT_select_linked);
121         WM_operatortype_append(POSE_OT_select_constraint_target);
122         WM_operatortype_append(POSE_OT_select_grouped);
123         WM_operatortype_append(POSE_OT_select_flip_active);
124         
125         WM_operatortype_append(POSE_OT_group_add);
126         WM_operatortype_append(POSE_OT_group_remove);
127         WM_operatortype_append(POSE_OT_group_move);
128         WM_operatortype_append(POSE_OT_group_sort);
129         WM_operatortype_append(POSE_OT_group_assign);
130         WM_operatortype_append(POSE_OT_group_unassign);
131         WM_operatortype_append(POSE_OT_group_select);
132         WM_operatortype_append(POSE_OT_group_deselect);
133         
134         WM_operatortype_append(POSE_OT_paths_calculate);
135         WM_operatortype_append(POSE_OT_paths_clear);
136         
137         WM_operatortype_append(POSE_OT_autoside_names);
138         WM_operatortype_append(POSE_OT_flip_names);
139         
140         WM_operatortype_append(POSE_OT_rotation_mode_set);
141
142         WM_operatortype_append(POSE_OT_quaternions_flip);
143         
144         WM_operatortype_append(POSE_OT_armature_layers);
145         WM_operatortype_append(POSE_OT_bone_layers);
146         
147         WM_operatortype_append(POSE_OT_propagate);
148         
149         /* POSELIB */
150         WM_operatortype_append(POSELIB_OT_browse_interactive);
151         WM_operatortype_append(POSELIB_OT_apply_pose);
152         
153         WM_operatortype_append(POSELIB_OT_pose_add);
154         WM_operatortype_append(POSELIB_OT_pose_remove);
155         WM_operatortype_append(POSELIB_OT_pose_rename);
156         
157         WM_operatortype_append(POSELIB_OT_new);
158         WM_operatortype_append(POSELIB_OT_unlink);
159         
160         WM_operatortype_append(POSELIB_OT_action_sanitise);
161         
162         /* POSE SLIDING */
163         WM_operatortype_append(POSE_OT_push);
164         WM_operatortype_append(POSE_OT_relax);
165         WM_operatortype_append(POSE_OT_breakdown);
166 }
167
168 void ED_operatormacros_armature(void)
169 {
170         wmOperatorType *ot;
171         wmOperatorTypeMacro *otmacro;
172         
173         ot = WM_operatortype_append_macro("ARMATURE_OT_duplicate_move", "Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER);
174         if(ot) {
175                 ot->description = "Make copies of the selected bones within the same armature and move them";
176                 WM_operatortype_macro_define(ot, "ARMATURE_OT_duplicate");
177                 otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
178                 RNA_enum_set(otmacro->ptr, "proportional", 0);
179         }
180
181         ot = WM_operatortype_append_macro("ARMATURE_OT_extrude_move", "Extrude", OPTYPE_UNDO|OPTYPE_REGISTER);
182         if(ot) {
183                 ot->description = "Create new bones from the selected joints and move them";
184                 otmacro=WM_operatortype_macro_define(ot, "ARMATURE_OT_extrude");
185                 RNA_boolean_set(otmacro->ptr, "forked", FALSE);
186                 otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
187                 RNA_enum_set(otmacro->ptr, "proportional", 0);
188         }
189         
190         // XXX would it be nicer to just be able to have standard extrude_move, but set the forked property separate?
191         // that would require fixing a properties bug 19733
192         ot = WM_operatortype_append_macro("ARMATURE_OT_extrude_forked", "Extrude Forked", OPTYPE_UNDO|OPTYPE_REGISTER);
193         if(ot) {
194                 ot->description = "Create new bones from the selected joints and move them";
195                 otmacro=WM_operatortype_macro_define(ot, "ARMATURE_OT_extrude");
196                 RNA_boolean_set(otmacro->ptr, "forked", TRUE);
197                 otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
198                 RNA_enum_set(otmacro->ptr, "proportional", 0);
199         }
200 }
201
202 void ED_keymap_armature(wmKeyConfig *keyconf)
203 {
204         wmKeyMap *keymap;
205         wmKeyMapItem *kmi;
206         
207         /* Armature ------------------------ */
208         keymap = WM_keymap_find(keyconf, "Armature", 0, 0);
209         keymap->poll = ED_operator_editarmature;
210         
211         /* Armature -> Etch-A-Ton ------------------------ */
212         WM_keymap_add_item(keymap, "SKETCH_OT_delete", XKEY, KM_PRESS, 0, 0);
213         WM_keymap_add_item(keymap, "SKETCH_OT_delete", DELKEY, KM_PRESS, 0, 0);
214         WM_keymap_add_item(keymap, "SKETCH_OT_finish_stroke", RIGHTMOUSE, KM_PRESS, 0, 0);
215         WM_keymap_add_item(keymap, "SKETCH_OT_cancel_stroke", ESCKEY, KM_PRESS, 0, 0);
216         // Already part of view3d select
217         //WM_keymap_add_item(keymap, "SKETCH_OT_select", SELECTMOUSE, KM_PRESS, 0, 0);
218
219         /* sketch poll checks mode */   
220         WM_keymap_add_item(keymap, "SKETCH_OT_gesture", LEFTMOUSE, KM_PRESS, KM_SHIFT, 0);
221         WM_keymap_add_item(keymap, "SKETCH_OT_draw_stroke", LEFTMOUSE, KM_PRESS, 0, 0);
222         kmi = WM_keymap_add_item(keymap, "SKETCH_OT_draw_stroke", LEFTMOUSE, KM_PRESS, KM_CTRL, 0);
223         RNA_boolean_set(kmi->ptr, "snap", TRUE);
224         WM_keymap_add_item(keymap, "SKETCH_OT_draw_preview", MOUSEMOVE, KM_ANY, 0, 0);
225         kmi = WM_keymap_add_item(keymap, "SKETCH_OT_draw_preview", MOUSEMOVE, KM_ANY, KM_CTRL, 0);
226         RNA_boolean_set(kmi->ptr, "snap", TRUE);
227
228         /* only set in editmode armature, by space_view3d listener */
229         kmi = WM_keymap_add_item(keymap, "ARMATURE_OT_hide", HKEY, KM_PRESS, 0, 0);
230         RNA_boolean_set(kmi->ptr, "unselected", FALSE);
231         kmi = WM_keymap_add_item(keymap, "ARMATURE_OT_hide", HKEY, KM_PRESS, KM_SHIFT, 0);
232         RNA_boolean_set(kmi->ptr, "unselected", TRUE);
233
234         WM_keymap_add_item(keymap, "ARMATURE_OT_reveal", HKEY, KM_PRESS, KM_ALT, 0);
235         WM_keymap_add_item(keymap, "ARMATURE_OT_align", AKEY, KM_PRESS, KM_CTRL|KM_ALT, 0);
236         WM_keymap_add_item(keymap, "ARMATURE_OT_calculate_roll", NKEY, KM_PRESS, KM_CTRL, 0);
237         
238         WM_keymap_add_item(keymap, "ARMATURE_OT_switch_direction", FKEY, KM_PRESS, KM_ALT, 0);
239         
240         WM_keymap_add_item(keymap, "ARMATURE_OT_bone_primitive_add", AKEY, KM_PRESS, KM_SHIFT, 0);
241         
242         WM_keymap_add_item(keymap, "ARMATURE_OT_parent_set", PKEY, KM_PRESS, KM_CTRL, 0);
243         WM_keymap_add_item(keymap, "ARMATURE_OT_parent_clear", PKEY, KM_PRESS, KM_ALT, 0);
244         
245         kmi = WM_keymap_add_item(keymap, "ARMATURE_OT_select_all", AKEY, KM_PRESS, 0, 0);
246                 RNA_enum_set(kmi->ptr, "action", SEL_TOGGLE);
247         kmi = WM_keymap_add_item(keymap, "ARMATURE_OT_select_all", IKEY, KM_PRESS, KM_CTRL, 0);
248                 RNA_enum_set(kmi->ptr, "action", SEL_INVERT);
249         
250         kmi = WM_keymap_add_item(keymap, "ARMATURE_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, 0, 0);
251                 RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_PARENT);
252                 RNA_boolean_set(kmi->ptr, "extend", FALSE);
253         kmi = WM_keymap_add_item(keymap, "ARMATURE_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, KM_SHIFT, 0);
254                 RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_PARENT);
255                 RNA_boolean_set(kmi->ptr, "extend", TRUE);
256         
257         kmi = WM_keymap_add_item(keymap, "ARMATURE_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, 0, 0);
258                 RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_CHILD);
259                 RNA_boolean_set(kmi->ptr, "extend", FALSE);
260         kmi = WM_keymap_add_item(keymap, "ARMATURE_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, KM_SHIFT, 0);
261                 RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_CHILD);
262                 RNA_boolean_set(kmi->ptr, "extend", TRUE);
263
264         WM_keymap_add_item(keymap, "ARMATURE_OT_select_linked", LKEY, KM_PRESS, 0, 0);
265         
266         WM_keymap_add_item(keymap, "ARMATURE_OT_delete", XKEY, KM_PRESS, 0, 0);
267         WM_keymap_add_item(keymap, "ARMATURE_OT_delete", DELKEY, KM_PRESS, 0, 0);
268         WM_keymap_add_item(keymap, "ARMATURE_OT_duplicate_move", DKEY, KM_PRESS, KM_SHIFT, 0);
269         WM_keymap_add_item(keymap, "ARMATURE_OT_extrude_move", EKEY, KM_PRESS, 0, 0);
270         WM_keymap_add_item(keymap, "ARMATURE_OT_extrude_forked", EKEY, KM_PRESS, KM_SHIFT, 0);
271         WM_keymap_add_item(keymap, "ARMATURE_OT_click_extrude", LEFTMOUSE, KM_CLICK, KM_CTRL, 0);
272         WM_keymap_add_item(keymap, "ARMATURE_OT_fill", FKEY, KM_PRESS, 0, 0);
273         WM_keymap_add_item(keymap, "ARMATURE_OT_merge", MKEY, KM_PRESS, KM_ALT, 0);
274         
275         WM_keymap_add_item(keymap, "ARMATURE_OT_separate", PKEY, KM_PRESS, KM_CTRL|KM_ALT, 0);
276         
277                 /* set flags */
278         WM_keymap_add_menu(keymap, "VIEW3D_MT_bone_options_toggle", WKEY, KM_PRESS, KM_SHIFT, 0);
279         WM_keymap_add_menu(keymap, "VIEW3D_MT_bone_options_enable", WKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0);
280         WM_keymap_add_menu(keymap, "VIEW3D_MT_bone_options_disable", WKEY, KM_PRESS, KM_ALT, 0);
281                 
282                 /* armature/bone layers */
283         WM_keymap_add_item(keymap, "ARMATURE_OT_layers_show_all", ACCENTGRAVEKEY, KM_PRESS, KM_CTRL, 0);
284         WM_keymap_add_item(keymap, "ARMATURE_OT_armature_layers", MKEY, KM_PRESS, KM_SHIFT, 0);
285         WM_keymap_add_item(keymap, "ARMATURE_OT_bone_layers", MKEY, KM_PRESS, 0, 0);
286         
287                 /* special transforms: */
288                 /*      1) envelope/b-bone size */
289         kmi = WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", SKEY, KM_PRESS, KM_CTRL|KM_ALT, 0);
290                 RNA_enum_set(kmi->ptr, "mode", TFM_BONESIZE);
291                 /*      2) set roll */
292         kmi = WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", RKEY, KM_PRESS, KM_CTRL, 0);
293                 RNA_enum_set(kmi->ptr, "mode", TFM_BONE_ROLL);
294                 
295                 /* menus */
296         WM_keymap_add_menu(keymap, "VIEW3D_MT_armature_specials", WKEY, KM_PRESS, 0, 0);
297
298         /* Pose ------------------------ */
299         /* only set in posemode, by space_view3d listener */
300         keymap = WM_keymap_find(keyconf, "Pose", 0, 0);
301         keymap->poll = ED_operator_posemode;
302         
303         /* set parent and add object are object-based operators, but we make them
304          * available here because it's useful to do in pose mode too */
305         WM_keymap_add_item(keymap, "OBJECT_OT_parent_set", PKEY, KM_PRESS, KM_CTRL, 0);
306         WM_keymap_add_menu(keymap, "INFO_MT_add", AKEY, KM_PRESS, KM_SHIFT, 0);
307         
308         kmi = WM_keymap_add_item(keymap, "POSE_OT_hide", HKEY, KM_PRESS, 0, 0);
309         RNA_boolean_set(kmi->ptr, "unselected", FALSE);
310         kmi = WM_keymap_add_item(keymap, "POSE_OT_hide", HKEY, KM_PRESS, KM_SHIFT, 0);
311         RNA_boolean_set(kmi->ptr, "unselected", TRUE);
312
313         WM_keymap_add_item(keymap, "POSE_OT_reveal", HKEY, KM_PRESS, KM_ALT, 0);
314         
315         WM_keymap_add_menu(keymap, "VIEW3D_MT_pose_apply", AKEY, KM_PRESS, KM_CTRL, 0);
316         
317         // TODO: clear pose
318         WM_keymap_add_item(keymap, "POSE_OT_rot_clear", RKEY, KM_PRESS, KM_ALT, 0);
319         WM_keymap_add_item(keymap, "POSE_OT_loc_clear", GKEY, KM_PRESS, KM_ALT, 0);
320         WM_keymap_add_item(keymap, "POSE_OT_scale_clear", SKEY, KM_PRESS, KM_ALT, 0);
321         
322         WM_keymap_add_item(keymap, "POSE_OT_quaternions_flip", FKEY, KM_PRESS, KM_ALT, 0);
323         
324         WM_keymap_add_item(keymap, "POSE_OT_rotation_mode_set", RKEY, KM_PRESS, KM_CTRL, 0);
325         
326         WM_keymap_add_item(keymap, "POSE_OT_copy", CKEY, KM_PRESS, KM_CTRL, 0);
327         kmi = WM_keymap_add_item(keymap, "POSE_OT_paste", VKEY, KM_PRESS, KM_CTRL, 0);
328         RNA_boolean_set(kmi->ptr, "flipped", FALSE);
329
330         kmi = WM_keymap_add_item(keymap, "POSE_OT_paste", VKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0);
331         RNA_boolean_set(kmi->ptr, "flipped", TRUE);
332         
333         kmi = WM_keymap_add_item(keymap, "POSE_OT_select_all", AKEY, KM_PRESS, 0, 0);
334                 RNA_enum_set(kmi->ptr, "action", SEL_TOGGLE);
335         kmi = WM_keymap_add_item(keymap, "POSE_OT_select_all", IKEY, KM_PRESS, KM_CTRL, 0);
336                 RNA_enum_set(kmi->ptr, "action", SEL_INVERT);
337
338         WM_keymap_add_item(keymap, "POSE_OT_select_parent", PKEY, KM_PRESS, KM_SHIFT, 0);
339
340         kmi = WM_keymap_add_item(keymap, "POSE_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, 0, 0);
341                 RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_PARENT);
342                 RNA_boolean_set(kmi->ptr, "extend", FALSE);
343         kmi = WM_keymap_add_item(keymap, "POSE_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, KM_SHIFT, 0);
344                 RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_PARENT);
345                 RNA_boolean_set(kmi->ptr, "extend", TRUE);
346         
347         kmi = WM_keymap_add_item(keymap, "POSE_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, 0, 0);
348                 RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_CHILD);
349                 RNA_boolean_set(kmi->ptr, "extend", FALSE);
350         kmi = WM_keymap_add_item(keymap, "POSE_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, KM_SHIFT, 0);
351                 RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_CHILD);
352                 RNA_boolean_set(kmi->ptr, "extend", TRUE);
353
354         WM_keymap_add_item(keymap, "POSE_OT_select_linked", LKEY, KM_PRESS, 0, 0);
355         WM_keymap_add_item(keymap, "POSE_OT_select_grouped", GKEY, KM_PRESS, KM_SHIFT, 0);
356         WM_keymap_add_item(keymap, "POSE_OT_select_flip_active", FKEY, KM_PRESS, KM_SHIFT, 0);
357         
358         WM_keymap_add_item(keymap, "POSE_OT_constraint_add_with_targets", CKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0);
359         WM_keymap_add_item(keymap, "POSE_OT_constraints_clear", CKEY, KM_PRESS, KM_CTRL|KM_ALT, 0);
360         WM_keymap_add_item(keymap, "POSE_OT_ik_add", IKEY, KM_PRESS, /*KM_CTRL|*/KM_SHIFT, 0);
361         WM_keymap_add_item(keymap, "POSE_OT_ik_clear", IKEY, KM_PRESS, KM_CTRL|KM_ALT, 0);
362         
363         WM_keymap_add_menu(keymap, "VIEW3D_MT_pose_group", GKEY, KM_PRESS, KM_CTRL, 0);
364         
365                 /* set flags */
366         WM_keymap_add_menu(keymap, "VIEW3D_MT_bone_options_toggle", WKEY, KM_PRESS, KM_SHIFT, 0);
367         WM_keymap_add_menu(keymap, "VIEW3D_MT_bone_options_enable", WKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0);
368         WM_keymap_add_menu(keymap, "VIEW3D_MT_bone_options_disable", WKEY, KM_PRESS, KM_ALT, 0);
369
370                 /* armature/bone layers */
371         WM_keymap_add_item(keymap, "ARMATURE_OT_layers_show_all", ACCENTGRAVEKEY, KM_PRESS, KM_CTRL, 0);
372         WM_keymap_add_item(keymap, "POSE_OT_armature_layers", MKEY, KM_PRESS, KM_SHIFT, 0);
373         WM_keymap_add_item(keymap, "POSE_OT_bone_layers", MKEY, KM_PRESS, 0, 0);
374         
375                 /* special transforms: */
376                 /*      1) envelope/b-bone size */
377         kmi = WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", SKEY, KM_PRESS, KM_CTRL|KM_ALT, 0);
378                 RNA_enum_set(kmi->ptr, "mode", TFM_BONESIZE);
379         
380                 /* keyframes management */
381         WM_keymap_verify_item(keymap, "ANIM_OT_keyframe_insert_menu", IKEY, KM_PRESS, 0, 0);
382         WM_keymap_verify_item(keymap, "ANIM_OT_keyframe_delete_v3d", IKEY, KM_PRESS, KM_ALT, 0);
383         WM_keymap_verify_item(keymap, "ANIM_OT_keying_set_active_set", IKEY, KM_PRESS, KM_CTRL|KM_SHIFT|KM_ALT, 0);
384         
385         /* Pose -> PoseLib ------------- */
386         /* only set in posemode, by space_view3d listener */
387         WM_keymap_add_item(keymap, "POSELIB_OT_browse_interactive", LKEY, KM_PRESS, KM_CTRL, 0);
388         
389         WM_keymap_add_item(keymap, "POSELIB_OT_pose_add", LKEY, KM_PRESS, KM_SHIFT, 0);
390         WM_keymap_add_item(keymap, "POSELIB_OT_pose_remove", LKEY, KM_PRESS, KM_ALT, 0);
391         WM_keymap_add_item(keymap, "POSELIB_OT_pose_rename", LKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0);
392         
393         /* Pose -> Pose Sliding ------------- */
394         /* only set in posemode, by space_view3d listener */
395         WM_keymap_add_item(keymap, "POSE_OT_push", EKEY, KM_PRESS, KM_CTRL, 0);
396         WM_keymap_add_item(keymap, "POSE_OT_relax", EKEY, KM_PRESS, KM_ALT, 0);
397         WM_keymap_add_item(keymap, "POSE_OT_breakdown", EKEY, KM_PRESS, KM_SHIFT, 0);
398 }
399