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