svn merge -r39781:39792 https://svn.blender.org/svnroot/bf-blender/trunk/blender...
[blender-staging.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         WM_operatortype_append(POSE_OT_select_inverse);
118
119         WM_operatortype_append(POSE_OT_select_parent);
120         WM_operatortype_append(POSE_OT_select_hierarchy);
121         WM_operatortype_append(POSE_OT_select_linked);
122         WM_operatortype_append(POSE_OT_select_constraint_target);
123         WM_operatortype_append(POSE_OT_select_grouped);
124         WM_operatortype_append(POSE_OT_select_flip_active);
125         
126         WM_operatortype_append(POSE_OT_group_add);
127         WM_operatortype_append(POSE_OT_group_remove);
128         WM_operatortype_append(POSE_OT_group_move);
129         WM_operatortype_append(POSE_OT_group_sort);
130         WM_operatortype_append(POSE_OT_group_assign);
131         WM_operatortype_append(POSE_OT_group_unassign);
132         WM_operatortype_append(POSE_OT_group_select);
133         WM_operatortype_append(POSE_OT_group_deselect);
134         
135         WM_operatortype_append(POSE_OT_paths_calculate);
136         WM_operatortype_append(POSE_OT_paths_clear);
137         
138         WM_operatortype_append(POSE_OT_autoside_names);
139         WM_operatortype_append(POSE_OT_flip_names);
140         
141         WM_operatortype_append(POSE_OT_rotation_mode_set);
142
143         WM_operatortype_append(POSE_OT_quaternions_flip);
144         
145         WM_operatortype_append(POSE_OT_armature_layers);
146         WM_operatortype_append(POSE_OT_bone_layers);
147         
148         WM_operatortype_append(POSE_OT_propagate);
149         
150         /* POSELIB */
151         WM_operatortype_append(POSELIB_OT_browse_interactive);
152         WM_operatortype_append(POSELIB_OT_apply_pose);
153         
154         WM_operatortype_append(POSELIB_OT_pose_add);
155         WM_operatortype_append(POSELIB_OT_pose_remove);
156         WM_operatortype_append(POSELIB_OT_pose_rename);
157         
158         WM_operatortype_append(POSELIB_OT_new);
159         WM_operatortype_append(POSELIB_OT_unlink);
160         
161         WM_operatortype_append(POSELIB_OT_action_sanitise);
162         
163         /* POSE SLIDING */
164         WM_operatortype_append(POSE_OT_push);
165         WM_operatortype_append(POSE_OT_relax);
166         WM_operatortype_append(POSE_OT_breakdown);
167 }
168
169 void ED_operatormacros_armature(void)
170 {
171         wmOperatorType *ot;
172         wmOperatorTypeMacro *otmacro;
173         
174         ot= WM_operatortype_append_macro("ARMATURE_OT_duplicate_move", "Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER);
175         if(ot) {
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                 otmacro=WM_operatortype_macro_define(ot, "ARMATURE_OT_extrude");
184                 RNA_boolean_set(otmacro->ptr, "forked", 0);
185                 otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
186                 RNA_enum_set(otmacro->ptr, "proportional", 0);
187         }
188         
189         // XXX would it be nicer to just be able to have standard extrude_move, but set the forked property separate?
190         // that would require fixing a properties bug 19733
191         ot= WM_operatortype_append_macro("ARMATURE_OT_extrude_forked", "Extrude Forked", OPTYPE_UNDO|OPTYPE_REGISTER);
192         if(ot) {
193                 otmacro=WM_operatortype_macro_define(ot, "ARMATURE_OT_extrude");
194                 RNA_boolean_set(otmacro->ptr, "forked", 1);
195                 otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
196                 RNA_enum_set(otmacro->ptr, "proportional", 0);
197         }
198 }
199
200 void ED_keymap_armature(wmKeyConfig *keyconf)
201 {
202         wmKeyMap *keymap;
203         wmKeyMapItem *kmi;
204         
205         /* Armature ------------------------ */
206         keymap= WM_keymap_find(keyconf, "Armature", 0, 0);
207         keymap->poll= ED_operator_editarmature;
208         
209         /* Armature -> Etch-A-Ton ------------------------ */
210         WM_keymap_add_item(keymap, "SKETCH_OT_delete", XKEY, KM_PRESS, 0, 0);
211         WM_keymap_add_item(keymap, "SKETCH_OT_delete", DELKEY, KM_PRESS, 0, 0);
212         WM_keymap_add_item(keymap, "SKETCH_OT_finish_stroke", RIGHTMOUSE, KM_PRESS, 0, 0);
213         WM_keymap_add_item(keymap, "SKETCH_OT_cancel_stroke", ESCKEY, KM_PRESS, 0, 0);
214         // Already part of view3d select
215         //WM_keymap_add_item(keymap, "SKETCH_OT_select", SELECTMOUSE, KM_PRESS, 0, 0);
216
217         /* sketch poll checks mode */   
218         WM_keymap_add_item(keymap, "SKETCH_OT_gesture", LEFTMOUSE, KM_PRESS, KM_SHIFT, 0);
219         WM_keymap_add_item(keymap, "SKETCH_OT_draw_stroke", LEFTMOUSE, KM_PRESS, 0, 0);
220         kmi = WM_keymap_add_item(keymap, "SKETCH_OT_draw_stroke", LEFTMOUSE, KM_PRESS, KM_CTRL, 0);
221         RNA_boolean_set(kmi->ptr, "snap", 1);
222         WM_keymap_add_item(keymap, "SKETCH_OT_draw_preview", MOUSEMOVE, KM_ANY, 0, 0);
223         kmi = WM_keymap_add_item(keymap, "SKETCH_OT_draw_preview", MOUSEMOVE, KM_ANY, KM_CTRL, 0);
224         RNA_boolean_set(kmi->ptr, "snap", 1);
225
226         /* only set in editmode armature, by space_view3d listener */
227         WM_keymap_add_item(keymap, "ARMATURE_OT_hide", HKEY, KM_PRESS, 0, 0);
228         kmi= WM_keymap_add_item(keymap, "ARMATURE_OT_hide", HKEY, KM_PRESS, KM_SHIFT, 0);
229                 RNA_boolean_set(kmi->ptr, "unselected", 1);
230         WM_keymap_add_item(keymap, "ARMATURE_OT_reveal", HKEY, KM_PRESS, KM_ALT, 0);
231         WM_keymap_add_item(keymap, "ARMATURE_OT_align", AKEY, KM_PRESS, KM_CTRL|KM_ALT, 0);
232         WM_keymap_add_item(keymap, "ARMATURE_OT_calculate_roll", NKEY, KM_PRESS, KM_CTRL, 0);
233         
234         WM_keymap_add_item(keymap, "ARMATURE_OT_switch_direction", FKEY, KM_PRESS, KM_ALT, 0);
235         
236         WM_keymap_add_item(keymap, "ARMATURE_OT_bone_primitive_add", AKEY, KM_PRESS, KM_SHIFT, 0);
237         
238         WM_keymap_add_item(keymap, "ARMATURE_OT_parent_set", PKEY, KM_PRESS, KM_CTRL, 0);
239         WM_keymap_add_item(keymap, "ARMATURE_OT_parent_clear", PKEY, KM_PRESS, KM_ALT, 0);
240         
241         WM_keymap_add_item(keymap, "ARMATURE_OT_select_all", AKEY, KM_PRESS, 0, 0);
242         WM_keymap_add_item(keymap, "ARMATURE_OT_select_inverse", IKEY, KM_PRESS, KM_CTRL, 0);
243         
244         kmi= WM_keymap_add_item(keymap, "ARMATURE_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, 0, 0);
245                 RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_PARENT);
246         kmi= WM_keymap_add_item(keymap, "ARMATURE_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, KM_SHIFT, 0);
247                 RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_PARENT);
248                 RNA_boolean_set(kmi->ptr, "extend", 1);
249         
250         kmi= WM_keymap_add_item(keymap, "ARMATURE_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, 0, 0);
251                 RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_CHILD);
252         kmi= WM_keymap_add_item(keymap, "ARMATURE_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, KM_SHIFT, 0);
253                 RNA_enum_set(kmi->ptr, "direction", BONE_SELECT_CHILD);
254                 RNA_boolean_set(kmi->ptr, "extend", 1);
255
256         WM_keymap_add_item(keymap, "ARMATURE_OT_select_linked", LKEY, KM_PRESS, 0, 0);
257         
258         WM_keymap_add_item(keymap, "ARMATURE_OT_delete", XKEY, KM_PRESS, 0, 0);
259         WM_keymap_add_item(keymap, "ARMATURE_OT_delete", DELKEY, KM_PRESS, 0, 0);
260         WM_keymap_add_item(keymap, "ARMATURE_OT_duplicate_move", DKEY, KM_PRESS, KM_SHIFT, 0);
261         WM_keymap_add_item(keymap, "ARMATURE_OT_extrude_move", EKEY, KM_PRESS, 0, 0);
262         WM_keymap_add_item(keymap, "ARMATURE_OT_extrude_forked", EKEY, KM_PRESS, KM_SHIFT, 0);
263         WM_keymap_add_item(keymap, "ARMATURE_OT_click_extrude", LEFTMOUSE, KM_CLICK, KM_CTRL, 0);
264         WM_keymap_add_item(keymap, "ARMATURE_OT_fill", FKEY, KM_PRESS, 0, 0);
265         WM_keymap_add_item(keymap, "ARMATURE_OT_merge", MKEY, KM_PRESS, KM_ALT, 0);
266         
267         WM_keymap_add_item(keymap, "ARMATURE_OT_separate", PKEY, KM_PRESS, KM_CTRL|KM_ALT, 0);
268         
269                 /* set flags */
270         WM_keymap_add_menu(keymap, "VIEW3D_MT_bone_options_toggle", WKEY, KM_PRESS, KM_SHIFT, 0);
271         WM_keymap_add_menu(keymap, "VIEW3D_MT_bone_options_enable", WKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0);
272         WM_keymap_add_menu(keymap, "VIEW3D_MT_bone_options_disable", WKEY, KM_PRESS, KM_ALT, 0);
273                 
274                 /* armature/bone layers */
275         WM_keymap_add_item(keymap, "ARMATURE_OT_layers_show_all", ACCENTGRAVEKEY, KM_PRESS, KM_CTRL, 0);
276         WM_keymap_add_item(keymap, "ARMATURE_OT_armature_layers", MKEY, KM_PRESS, KM_SHIFT, 0);
277         WM_keymap_add_item(keymap, "ARMATURE_OT_bone_layers", MKEY, KM_PRESS, 0, 0);
278         
279                 /* special transforms: */
280                 /*      1) envelope/b-bone size */
281         kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", SKEY, KM_PRESS, KM_CTRL|KM_ALT, 0);
282                 RNA_enum_set(kmi->ptr, "mode", TFM_BONESIZE);
283                 /*      2) set roll */
284         kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", RKEY, KM_PRESS, KM_CTRL, 0);
285                 RNA_enum_set(kmi->ptr, "mode", TFM_BONE_ROLL);
286                 
287                 /* menus */
288         WM_keymap_add_menu(keymap, "VIEW3D_MT_armature_specials", WKEY, KM_PRESS, 0, 0);
289
290         /* Pose ------------------------ */
291         /* only set in posemode, by space_view3d listener */
292         keymap= WM_keymap_find(keyconf, "Pose", 0, 0);
293         keymap->poll= ED_operator_posemode;
294         
295         /* set parent and add object are object-based operators, but we make them
296            available here because it's useful to do in pose mode too */
297         WM_keymap_add_item(keymap, "OBJECT_OT_parent_set", PKEY, KM_PRESS, KM_CTRL, 0);
298         WM_keymap_add_menu(keymap, "INFO_MT_add", AKEY, KM_PRESS, KM_SHIFT, 0);
299         
300         WM_keymap_add_item(keymap, "POSE_OT_hide", HKEY, KM_PRESS, 0, 0);
301         kmi= WM_keymap_add_item(keymap, "POSE_OT_hide", HKEY, KM_PRESS, KM_SHIFT, 0);
302                 RNA_boolean_set(kmi->ptr, "unselected", 1);
303         WM_keymap_add_item(keymap, "POSE_OT_reveal", HKEY, KM_PRESS, KM_ALT, 0);
304         
305         WM_keymap_add_menu(keymap, "VIEW3D_MT_pose_apply", AKEY, KM_PRESS, KM_CTRL, 0);
306         
307         // TODO: clear pose
308         WM_keymap_add_item(keymap, "POSE_OT_rot_clear", RKEY, KM_PRESS, KM_ALT, 0);
309         WM_keymap_add_item(keymap, "POSE_OT_loc_clear", GKEY, KM_PRESS, KM_ALT, 0);
310         WM_keymap_add_item(keymap, "POSE_OT_scale_clear", SKEY, KM_PRESS, KM_ALT, 0);
311         
312         WM_keymap_add_item(keymap, "POSE_OT_quaternions_flip", FKEY, KM_PRESS, KM_ALT, 0);
313         
314         WM_keymap_add_item(keymap, "POSE_OT_rotation_mode_set", RKEY, KM_PRESS, KM_CTRL, 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         WM_keymap_add_menu(keymap, "VIEW3D_MT_bone_options_toggle", WKEY, KM_PRESS, KM_SHIFT, 0);
351         WM_keymap_add_menu(keymap, "VIEW3D_MT_bone_options_enable", WKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0);
352         WM_keymap_add_menu(keymap, "VIEW3D_MT_bone_options_disable", WKEY, KM_PRESS, KM_ALT, 0);
353
354                 /* armature/bone layers */
355         WM_keymap_add_item(keymap, "ARMATURE_OT_layers_show_all", ACCENTGRAVEKEY, KM_PRESS, KM_CTRL, 0);
356         WM_keymap_add_item(keymap, "POSE_OT_armature_layers", MKEY, KM_PRESS, KM_SHIFT, 0);
357         WM_keymap_add_item(keymap, "POSE_OT_bone_layers", MKEY, KM_PRESS, 0, 0);
358         
359                 /* special transforms: */
360                 /*      1) envelope/b-bone size */
361         kmi= WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", SKEY, KM_PRESS, KM_CTRL|KM_ALT, 0);
362                 RNA_enum_set(kmi->ptr, "mode", TFM_BONESIZE);
363         
364                 /* keyframes management */
365         WM_keymap_verify_item(keymap, "ANIM_OT_keyframe_insert_menu", IKEY, KM_PRESS, 0, 0);
366         WM_keymap_verify_item(keymap, "ANIM_OT_keyframe_delete_v3d", IKEY, KM_PRESS, KM_ALT, 0);
367         WM_keymap_verify_item(keymap, "ANIM_OT_keying_set_active_set", IKEY, KM_PRESS, KM_CTRL|KM_SHIFT|KM_ALT, 0);
368         
369         /* Pose -> PoseLib ------------- */
370         /* only set in posemode, by space_view3d listener */
371         WM_keymap_add_item(keymap, "POSELIB_OT_browse_interactive", LKEY, KM_PRESS, KM_CTRL, 0);
372         
373         WM_keymap_add_item(keymap, "POSELIB_OT_pose_add", LKEY, KM_PRESS, KM_SHIFT, 0);
374         WM_keymap_add_item(keymap, "POSELIB_OT_pose_remove", LKEY, KM_PRESS, KM_ALT, 0);
375         WM_keymap_add_item(keymap, "POSELIB_OT_pose_rename", LKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0);
376         
377         /* Pose -> Pose Sliding ------------- */
378         /* only set in posemode, by space_view3d listener */
379         WM_keymap_add_item(keymap, "POSE_OT_push", EKEY, KM_PRESS, KM_CTRL, 0);
380         WM_keymap_add_item(keymap, "POSE_OT_relax", EKEY, KM_PRESS, KM_ALT, 0);
381         WM_keymap_add_item(keymap, "POSE_OT_breakdown", EKEY, KM_PRESS, KM_SHIFT, 0);
382 }
383