2011-02-23 10:52:22 +00:00
|
|
|
/*
|
2008-12-23 11:02:39 +00:00
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
|
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2008-12-23 11:02:39 +00:00
|
|
|
*
|
|
|
|
|
* The Original Code is Copyright (C) 2008 Blender Foundation.
|
|
|
|
|
* All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* Contributor(s): Blender Foundation
|
|
|
|
|
*
|
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
|
*/
|
|
|
|
|
|
2011-02-27 20:29:51 +00:00
|
|
|
/** \file blender/editors/space_action/action_ops.c
|
|
|
|
|
* \ingroup spaction
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
2008-12-23 11:02:39 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <math.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "DNA_space_types.h"
|
|
|
|
|
|
|
|
|
|
|
2011-04-03 10:04:16 +00:00
|
|
|
#include "ED_anim_api.h"
|
2011-06-01 06:26:54 +00:00
|
|
|
#include "ED_markers.h"
|
2009-07-08 16:17:47 +00:00
|
|
|
#include "ED_transform.h"
|
2008-12-29 07:19:16 +00:00
|
|
|
|
2008-12-23 11:02:39 +00:00
|
|
|
#include "action_intern.h"
|
|
|
|
|
|
|
|
|
|
#include "RNA_access.h"
|
|
|
|
|
|
|
|
|
|
#include "WM_api.h"
|
|
|
|
|
#include "WM_types.h"
|
|
|
|
|
|
|
|
|
|
/* ************************** registration - operator types **********************************/
|
|
|
|
|
|
|
|
|
|
void action_operatortypes(void)
|
|
|
|
|
{
|
|
|
|
|
/* keyframes */
|
2012-05-08 16:02:13 +00:00
|
|
|
/* selection */
|
2009-11-28 14:37:21 +00:00
|
|
|
WM_operatortype_append(ACTION_OT_clickselect);
|
|
|
|
|
WM_operatortype_append(ACTION_OT_select_all_toggle);
|
|
|
|
|
WM_operatortype_append(ACTION_OT_select_border);
|
|
|
|
|
WM_operatortype_append(ACTION_OT_select_column);
|
2010-04-05 12:17:33 +00:00
|
|
|
WM_operatortype_append(ACTION_OT_select_linked);
|
2010-02-07 11:50:03 +00:00
|
|
|
WM_operatortype_append(ACTION_OT_select_more);
|
|
|
|
|
WM_operatortype_append(ACTION_OT_select_less);
|
2011-02-14 02:30:33 +00:00
|
|
|
WM_operatortype_append(ACTION_OT_select_leftright);
|
2008-12-27 11:44:00 +00:00
|
|
|
|
2012-05-08 16:02:13 +00:00
|
|
|
/* editing */
|
2009-11-28 14:37:21 +00:00
|
|
|
WM_operatortype_append(ACTION_OT_snap);
|
|
|
|
|
WM_operatortype_append(ACTION_OT_mirror);
|
|
|
|
|
WM_operatortype_append(ACTION_OT_frame_jump);
|
|
|
|
|
WM_operatortype_append(ACTION_OT_handle_type);
|
|
|
|
|
WM_operatortype_append(ACTION_OT_interpolation_type);
|
|
|
|
|
WM_operatortype_append(ACTION_OT_extrapolation_type);
|
|
|
|
|
WM_operatortype_append(ACTION_OT_keyframe_type);
|
|
|
|
|
WM_operatortype_append(ACTION_OT_sample);
|
|
|
|
|
WM_operatortype_append(ACTION_OT_clean);
|
|
|
|
|
WM_operatortype_append(ACTION_OT_delete);
|
|
|
|
|
WM_operatortype_append(ACTION_OT_duplicate);
|
2009-12-31 23:56:45 +00:00
|
|
|
WM_operatortype_append(ACTION_OT_keyframe_insert);
|
2009-11-28 14:37:21 +00:00
|
|
|
WM_operatortype_append(ACTION_OT_copy);
|
|
|
|
|
WM_operatortype_append(ACTION_OT_paste);
|
|
|
|
|
WM_operatortype_append(ACTION_OT_new);
|
|
|
|
|
|
|
|
|
|
WM_operatortype_append(ACTION_OT_previewrange_set);
|
|
|
|
|
WM_operatortype_append(ACTION_OT_view_all);
|
2011-03-17 10:02:37 +00:00
|
|
|
WM_operatortype_append(ACTION_OT_view_selected);
|
2011-02-26 06:28:24 +00:00
|
|
|
|
|
|
|
|
WM_operatortype_append(ACTION_OT_markers_make_local);
|
2008-12-23 11:02:39 +00:00
|
|
|
}
|
|
|
|
|
|
2011-03-05 14:03:29 +00:00
|
|
|
void ED_operatormacros_action(void)
|
|
|
|
|
{
|
|
|
|
|
wmOperatorType *ot;
|
|
|
|
|
wmOperatorTypeMacro *otmacro;
|
|
|
|
|
|
2012-05-05 19:26:53 +00:00
|
|
|
ot = WM_operatortype_append_macro("ACTION_OT_duplicate_move", "Duplicate",
|
|
|
|
|
"Make a copy of all selected keyframes and move them",
|
2012-05-08 16:02:13 +00:00
|
|
|
OPTYPE_UNDO | OPTYPE_REGISTER);
|
2013-10-26 08:01:33 +00:00
|
|
|
WM_operatortype_macro_define(ot, "ACTION_OT_duplicate");
|
|
|
|
|
otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_transform");
|
|
|
|
|
RNA_enum_set(otmacro->ptr, "mode", TFM_TIME_DUPLICATE);
|
2011-03-05 14:03:29 +00:00
|
|
|
}
|
|
|
|
|
|
2008-12-23 11:02:39 +00:00
|
|
|
/* ************************** registration - keymaps **********************************/
|
|
|
|
|
|
2012-05-08 16:02:13 +00:00
|
|
|
static void action_keymap_keyframes(wmKeyConfig *keyconf, wmKeyMap *keymap)
|
2008-12-23 11:02:39 +00:00
|
|
|
{
|
Key Configuration
Keymaps are now saveable and configurable from the user preferences, note
that editing one item in a keymap means the whole keymap is now defined by
the user and will not be updated by Blender, an option for syncing might be
added later. The outliner interface is still there, but I will probably
remove it.
There's actually 3 levels now:
* Default builtin key configuration.
* Key configuration loaded from .py file, for configs like Blender 2.4x
or other 3D applications.
* Keymaps edited by the user and saved in .B.blend. These can be saved
to .py files as well to make creating distributable configurations
easier.
Also, user preferences sections were reorganized a bit, now there is:
Interface, Editing, Input, Files and System.
Implementation notes:
* wmKeyConfig was added which represents a key configuration containing
keymaps.
* wmKeymapItem was renamed to wmKeyMapItem for consistency with wmKeyMap.
* Modal maps are not wrapped yet.
* User preferences DNA file reading did not support newdataadr() yet,
added this now for reading keymaps.
* Key configuration related settings are now RNA wrapped.
* is_property_set and is_property_hidden python methods were added.
2009-10-08 18:40:03 +00:00
|
|
|
wmKeyMapItem *kmi;
|
2009-04-12 08:21:22 +00:00
|
|
|
|
2.5 - Action Editor: All Keyframe Selection Tools Ported
User Notes (for using tools whose behaviour has changed):
* Mouse Selection Tools:
1) Click on keyframe to modify its selection. Holding the 'Shift' modifier when doing so, will result in keyframe selection being toggled instead of replacing existing selections.
2) Click on either side of the current frame indicator while holding the 'Alt' modifier. This will select only all the keyframes on the relevant side of the current frame indicator.
3) Click on a keyframe while holding the 'Ctrl' modifier. This will select all the keyframes that fall on that frame.
* Borderselect Tools
1) BKEY selects all the keyframes within the specified range (as per normal)
2) ALT-BKEY will select either all the keyframes in the frame-range specified or the channel range specified, depending on which axis of the select region was larger. This method is prejudiced towards frame-range selection.
Code Notes:
* Finished porting over all of the remaining keyframe selection tools, and recoded the ported ones to make them easier to use (after running into some technical limitations)
* Simplified the way to check if 'animation context' is valid by moving a necessary check into that function.
* Refactored internal keyframe-looping tools to reduce the amount of code needed per tool to edit keyframes, removing a lot of the unnecessary bulk. Now, the ipo/icu_keys_bezier_loop functions recieve a few more arguments (1st arg is pointer to generic customdata, and another defines a validation callback which makes it easier to reuse some of the select callbacks).
* Added 'totrect' adjustment for number of channels being shown in Action Editor, so that scrolling will be limited to where there is data (and also so that scroller displays more relevant context info).
For this to work, filtering channels now returns the number of channels extracted. This may come into use for other tools if there's such a need.
* I still need to port over some code for markers, which is required for some of the tools which use them. For now, those tools do nothing.
* Grease-Pencil editing mode in Action Editor is currently non-functional (code is commented out due to missing dependencies). This is currently pending the re-implementation of Grease Pencil in 2.5
2008-12-26 10:55:07 +00:00
|
|
|
/* action_select.c - selection tools */
|
2013-10-22 09:59:54 +00:00
|
|
|
/* click-select: keyframe (replace) */
|
2012-01-14 22:59:51 +00:00
|
|
|
kmi = WM_keymap_add_item(keymap, "ACTION_OT_clickselect", SELECTMOUSE, KM_PRESS, 0, 0);
|
2014-04-01 11:34:00 +11:00
|
|
|
RNA_boolean_set(kmi->ptr, "extend", false);
|
|
|
|
|
RNA_boolean_set(kmi->ptr, "column", false);
|
|
|
|
|
RNA_boolean_set(kmi->ptr, "channel", false);
|
2013-10-22 09:59:54 +00:00
|
|
|
/* click-select: all on same frame (replace) */
|
2012-03-24 02:51:46 +00:00
|
|
|
kmi = WM_keymap_add_item(keymap, "ACTION_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_ALT, 0);
|
2014-04-01 11:34:00 +11:00
|
|
|
RNA_boolean_set(kmi->ptr, "extend", false);
|
|
|
|
|
RNA_boolean_set(kmi->ptr, "column", true);
|
|
|
|
|
RNA_boolean_set(kmi->ptr, "channel", false);
|
2013-10-22 09:59:54 +00:00
|
|
|
/* click-select: keyframe (add) */
|
2012-03-24 02:51:46 +00:00
|
|
|
kmi = WM_keymap_add_item(keymap, "ACTION_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0);
|
2014-04-01 11:34:00 +11:00
|
|
|
RNA_boolean_set(kmi->ptr, "extend", true);
|
|
|
|
|
RNA_boolean_set(kmi->ptr, "column", false);
|
|
|
|
|
RNA_boolean_set(kmi->ptr, "channel", false);
|
2013-10-22 11:12:37 +00:00
|
|
|
/* click-select: all on same frame (add) */
|
2012-05-08 16:02:13 +00:00
|
|
|
kmi = WM_keymap_add_item(keymap, "ACTION_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_ALT | KM_SHIFT, 0);
|
2014-04-01 11:34:00 +11:00
|
|
|
RNA_boolean_set(kmi->ptr, "extend", true);
|
|
|
|
|
RNA_boolean_set(kmi->ptr, "column", true);
|
|
|
|
|
RNA_boolean_set(kmi->ptr, "channel", false);
|
2013-10-22 11:12:37 +00:00
|
|
|
/* click-select: all on same channel (replace) */
|
|
|
|
|
kmi = WM_keymap_add_item(keymap, "ACTION_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_CTRL | KM_ALT, 0);
|
2014-04-01 11:34:00 +11:00
|
|
|
RNA_boolean_set(kmi->ptr, "extend", false);
|
|
|
|
|
RNA_boolean_set(kmi->ptr, "column", false);
|
|
|
|
|
RNA_boolean_set(kmi->ptr, "channel", true);
|
2013-10-22 11:12:37 +00:00
|
|
|
/* click-select: all on same channel (add) */
|
|
|
|
|
kmi = WM_keymap_add_item(keymap, "ACTION_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_CTRL | KM_ALT | KM_SHIFT, 0);
|
2014-04-01 11:34:00 +11:00
|
|
|
RNA_boolean_set(kmi->ptr, "extend", true);
|
|
|
|
|
RNA_boolean_set(kmi->ptr, "column", false);
|
|
|
|
|
RNA_boolean_set(kmi->ptr, "channel", true);
|
2011-02-14 02:30:33 +00:00
|
|
|
|
2013-10-22 09:59:54 +00:00
|
|
|
/* click-select: left/right */
|
2012-01-14 22:59:51 +00:00
|
|
|
kmi = WM_keymap_add_item(keymap, "ACTION_OT_select_leftright", SELECTMOUSE, KM_PRESS, KM_CTRL, 0);
|
2014-04-01 11:34:00 +11:00
|
|
|
RNA_boolean_set(kmi->ptr, "extend", false);
|
2012-05-08 16:02:13 +00:00
|
|
|
RNA_enum_set(kmi->ptr, "mode", ACTKEYS_LRSEL_TEST);
|
|
|
|
|
kmi = WM_keymap_add_item(keymap, "ACTION_OT_select_leftright", SELECTMOUSE, KM_PRESS, KM_CTRL | KM_SHIFT, 0);
|
2014-04-01 11:34:00 +11:00
|
|
|
RNA_boolean_set(kmi->ptr, "extend", true);
|
2012-05-08 16:02:13 +00:00
|
|
|
RNA_enum_set(kmi->ptr, "mode", ACTKEYS_LRSEL_TEST);
|
2011-02-14 02:30:33 +00:00
|
|
|
|
2012-03-24 02:51:46 +00:00
|
|
|
kmi = WM_keymap_add_item(keymap, "ACTION_OT_select_leftright", LEFTBRACKETKEY, KM_PRESS, 0, 0);
|
2014-04-01 11:34:00 +11:00
|
|
|
RNA_boolean_set(kmi->ptr, "extend", false);
|
2012-05-08 16:02:13 +00:00
|
|
|
RNA_enum_set(kmi->ptr, "mode", ACTKEYS_LRSEL_LEFT);
|
2012-03-24 02:51:46 +00:00
|
|
|
kmi = WM_keymap_add_item(keymap, "ACTION_OT_select_leftright", RIGHTBRACKETKEY, KM_PRESS, 0, 0);
|
2014-04-01 11:34:00 +11:00
|
|
|
RNA_boolean_set(kmi->ptr, "extend", false);
|
2012-05-08 16:02:13 +00:00
|
|
|
RNA_enum_set(kmi->ptr, "mode", ACTKEYS_LRSEL_RIGHT);
|
2.5 - Action Editor: All Keyframe Selection Tools Ported
User Notes (for using tools whose behaviour has changed):
* Mouse Selection Tools:
1) Click on keyframe to modify its selection. Holding the 'Shift' modifier when doing so, will result in keyframe selection being toggled instead of replacing existing selections.
2) Click on either side of the current frame indicator while holding the 'Alt' modifier. This will select only all the keyframes on the relevant side of the current frame indicator.
3) Click on a keyframe while holding the 'Ctrl' modifier. This will select all the keyframes that fall on that frame.
* Borderselect Tools
1) BKEY selects all the keyframes within the specified range (as per normal)
2) ALT-BKEY will select either all the keyframes in the frame-range specified or the channel range specified, depending on which axis of the select region was larger. This method is prejudiced towards frame-range selection.
Code Notes:
* Finished porting over all of the remaining keyframe selection tools, and recoded the ported ones to make them easier to use (after running into some technical limitations)
* Simplified the way to check if 'animation context' is valid by moving a necessary check into that function.
* Refactored internal keyframe-looping tools to reduce the amount of code needed per tool to edit keyframes, removing a lot of the unnecessary bulk. Now, the ipo/icu_keys_bezier_loop functions recieve a few more arguments (1st arg is pointer to generic customdata, and another defines a validation callback which makes it easier to reuse some of the select callbacks).
* Added 'totrect' adjustment for number of channels being shown in Action Editor, so that scrolling will be limited to where there is data (and also so that scroller displays more relevant context info).
For this to work, filtering channels now returns the number of channels extracted. This may come into use for other tools if there's such a need.
* I still need to port over some code for markers, which is required for some of the tools which use them. For now, those tools do nothing.
* Grease-Pencil editing mode in Action Editor is currently non-functional (code is commented out due to missing dependencies). This is currently pending the re-implementation of Grease Pencil in 2.5
2008-12-26 10:55:07 +00:00
|
|
|
|
2012-05-08 16:02:13 +00:00
|
|
|
/* deselect all */
|
2012-01-14 22:59:51 +00:00
|
|
|
kmi = WM_keymap_add_item(keymap, "ACTION_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0);
|
2014-04-01 11:34:00 +11:00
|
|
|
RNA_boolean_set(kmi->ptr, "invert", false);
|
2012-01-14 22:59:51 +00:00
|
|
|
kmi = WM_keymap_add_item(keymap, "ACTION_OT_select_all_toggle", IKEY, KM_PRESS, KM_CTRL, 0);
|
2014-04-01 11:34:00 +11:00
|
|
|
RNA_boolean_set(kmi->ptr, "invert", true);
|
2008-12-23 23:34:19 +00:00
|
|
|
|
2012-05-08 16:02:13 +00:00
|
|
|
/* borderselect */
|
2012-01-14 22:59:51 +00:00
|
|
|
kmi = WM_keymap_add_item(keymap, "ACTION_OT_select_border", BKEY, KM_PRESS, 0, 0);
|
2014-04-01 11:34:00 +11:00
|
|
|
RNA_boolean_set(kmi->ptr, "axis_range", false);
|
2012-01-14 22:59:51 +00:00
|
|
|
kmi = WM_keymap_add_item(keymap, "ACTION_OT_select_border", BKEY, KM_PRESS, KM_ALT, 0);
|
2014-04-01 11:34:00 +11:00
|
|
|
RNA_boolean_set(kmi->ptr, "axis_range", true);
|
2.5 - Action Editor: All Keyframe Selection Tools Ported
User Notes (for using tools whose behaviour has changed):
* Mouse Selection Tools:
1) Click on keyframe to modify its selection. Holding the 'Shift' modifier when doing so, will result in keyframe selection being toggled instead of replacing existing selections.
2) Click on either side of the current frame indicator while holding the 'Alt' modifier. This will select only all the keyframes on the relevant side of the current frame indicator.
3) Click on a keyframe while holding the 'Ctrl' modifier. This will select all the keyframes that fall on that frame.
* Borderselect Tools
1) BKEY selects all the keyframes within the specified range (as per normal)
2) ALT-BKEY will select either all the keyframes in the frame-range specified or the channel range specified, depending on which axis of the select region was larger. This method is prejudiced towards frame-range selection.
Code Notes:
* Finished porting over all of the remaining keyframe selection tools, and recoded the ported ones to make them easier to use (after running into some technical limitations)
* Simplified the way to check if 'animation context' is valid by moving a necessary check into that function.
* Refactored internal keyframe-looping tools to reduce the amount of code needed per tool to edit keyframes, removing a lot of the unnecessary bulk. Now, the ipo/icu_keys_bezier_loop functions recieve a few more arguments (1st arg is pointer to generic customdata, and another defines a validation callback which makes it easier to reuse some of the select callbacks).
* Added 'totrect' adjustment for number of channels being shown in Action Editor, so that scrolling will be limited to where there is data (and also so that scroller displays more relevant context info).
For this to work, filtering channels now returns the number of channels extracted. This may come into use for other tools if there's such a need.
* I still need to port over some code for markers, which is required for some of the tools which use them. For now, those tools do nothing.
* Grease-Pencil editing mode in Action Editor is currently non-functional (code is commented out due to missing dependencies). This is currently pending the re-implementation of Grease Pencil in 2.5
2008-12-26 10:55:07 +00:00
|
|
|
|
2012-05-08 16:02:13 +00:00
|
|
|
/* column select */
|
2009-11-28 14:37:21 +00:00
|
|
|
RNA_enum_set(WM_keymap_add_item(keymap, "ACTION_OT_select_column", KKEY, KM_PRESS, 0, 0)->ptr, "mode", ACTKEYS_COLUMNSEL_KEYS);
|
|
|
|
|
RNA_enum_set(WM_keymap_add_item(keymap, "ACTION_OT_select_column", KKEY, KM_PRESS, KM_CTRL, 0)->ptr, "mode", ACTKEYS_COLUMNSEL_CFRA);
|
|
|
|
|
RNA_enum_set(WM_keymap_add_item(keymap, "ACTION_OT_select_column", KKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "mode", ACTKEYS_COLUMNSEL_MARKERS_COLUMN);
|
|
|
|
|
RNA_enum_set(WM_keymap_add_item(keymap, "ACTION_OT_select_column", KKEY, KM_PRESS, KM_ALT, 0)->ptr, "mode", ACTKEYS_COLUMNSEL_MARKERS_BETWEEN);
|
2008-12-27 11:44:00 +00:00
|
|
|
|
2012-05-08 16:02:13 +00:00
|
|
|
/* select more/less */
|
2010-02-07 11:50:03 +00:00
|
|
|
WM_keymap_add_item(keymap, "ACTION_OT_select_more", PADPLUSKEY, KM_PRESS, KM_CTRL, 0);
|
|
|
|
|
WM_keymap_add_item(keymap, "ACTION_OT_select_less", PADMINUS, KM_PRESS, KM_CTRL, 0);
|
|
|
|
|
|
2013-10-22 09:59:54 +00:00
|
|
|
/* select linked */
|
2010-04-05 11:47:55 +00:00
|
|
|
WM_keymap_add_item(keymap, "ACTION_OT_select_linked", LKEY, KM_PRESS, 0, 0);
|
|
|
|
|
|
2010-02-07 11:50:03 +00:00
|
|
|
|
2009-01-01 01:47:36 +00:00
|
|
|
/* action_edit.c */
|
2012-10-15 03:52:27 +00:00
|
|
|
/* jump to selected keyframes */
|
|
|
|
|
WM_keymap_add_item(keymap, "ACTION_OT_frame_jump", GKEY, KM_PRESS, KM_CTRL, 0);
|
2008-12-28 04:13:18 +00:00
|
|
|
|
2012-05-08 16:02:13 +00:00
|
|
|
/* menu + single-step transform */
|
2009-11-28 14:37:21 +00:00
|
|
|
WM_keymap_add_item(keymap, "ACTION_OT_snap", SKEY, KM_PRESS, KM_SHIFT, 0);
|
|
|
|
|
WM_keymap_add_item(keymap, "ACTION_OT_mirror", MKEY, KM_PRESS, KM_SHIFT, 0);
|
2008-12-28 08:15:29 +00:00
|
|
|
|
2012-05-08 16:02:13 +00:00
|
|
|
/* menu + set setting */
|
2010-12-14 10:52:38 +00:00
|
|
|
WM_keymap_add_item(keymap, "ACTION_OT_handle_type", VKEY, KM_PRESS, 0, 0);
|
2011-05-25 13:10:07 +00:00
|
|
|
WM_keymap_add_item(keymap, "ACTION_OT_interpolation_type", TKEY, KM_PRESS, 0, 0);
|
2009-11-28 14:37:21 +00:00
|
|
|
WM_keymap_add_item(keymap, "ACTION_OT_extrapolation_type", EKEY, KM_PRESS, KM_SHIFT, 0);
|
|
|
|
|
WM_keymap_add_item(keymap, "ACTION_OT_keyframe_type", RKEY, KM_PRESS, 0, 0);
|
2008-12-29 01:19:25 +00:00
|
|
|
|
2012-05-08 16:02:13 +00:00
|
|
|
/* destructive */
|
2009-11-28 14:37:21 +00:00
|
|
|
WM_keymap_add_item(keymap, "ACTION_OT_clean", OKEY, KM_PRESS, 0, 0);
|
|
|
|
|
WM_keymap_add_item(keymap, "ACTION_OT_sample", OKEY, KM_PRESS, KM_SHIFT, 0);
|
2008-12-29 01:19:25 +00:00
|
|
|
|
2009-11-28 14:37:21 +00:00
|
|
|
WM_keymap_add_item(keymap, "ACTION_OT_delete", XKEY, KM_PRESS, 0, 0);
|
|
|
|
|
WM_keymap_add_item(keymap, "ACTION_OT_delete", DELKEY, KM_PRESS, 0, 0);
|
2008-12-29 07:19:16 +00:00
|
|
|
|
2011-03-05 14:03:29 +00:00
|
|
|
WM_keymap_add_item(keymap, "ACTION_OT_duplicate_move", DKEY, KM_PRESS, KM_SHIFT, 0);
|
2009-12-31 23:56:45 +00:00
|
|
|
WM_keymap_add_item(keymap, "ACTION_OT_keyframe_insert", IKEY, KM_PRESS, 0, 0);
|
2009-02-20 11:17:33 +00:00
|
|
|
|
2012-05-08 16:02:13 +00:00
|
|
|
/* copy/paste */
|
2009-11-28 14:37:21 +00:00
|
|
|
WM_keymap_add_item(keymap, "ACTION_OT_copy", CKEY, KM_PRESS, KM_CTRL, 0);
|
|
|
|
|
WM_keymap_add_item(keymap, "ACTION_OT_paste", VKEY, KM_PRESS, KM_CTRL, 0);
|
2015-01-07 22:25:33 +01:00
|
|
|
kmi = WM_keymap_add_item(keymap, "ACTION_OT_paste", VKEY, KM_PRESS, KM_CTRL | KM_SHIFT, 0);
|
|
|
|
|
RNA_boolean_set(kmi->ptr, "flipped", true);
|
2013-05-11 01:12:29 +00:00
|
|
|
#ifdef __APPLE__
|
|
|
|
|
WM_keymap_add_item(keymap, "ACTION_OT_copy", CKEY, KM_PRESS, KM_OSKEY, 0);
|
2013-05-10 13:47:28 +00:00
|
|
|
WM_keymap_add_item(keymap, "ACTION_OT_paste", VKEY, KM_PRESS, KM_OSKEY, 0);
|
2015-01-07 22:25:33 +01:00
|
|
|
kmi = WM_keymap_add_item(keymap, "ACTION_OT_paste", VKEY, KM_PRESS, KM_OSKEY | KM_SHIFT, 0);
|
|
|
|
|
RNA_boolean_set(kmi->ptr, "flipped", true);
|
2013-05-11 01:12:29 +00:00
|
|
|
#endif
|
|
|
|
|
|
2012-05-08 16:02:13 +00:00
|
|
|
/* auto-set range */
|
|
|
|
|
WM_keymap_add_item(keymap, "ACTION_OT_previewrange_set", PKEY, KM_PRESS, KM_CTRL | KM_ALT, 0);
|
2009-11-28 14:37:21 +00:00
|
|
|
WM_keymap_add_item(keymap, "ACTION_OT_view_all", HOMEKEY, KM_PRESS, 0, 0);
|
2014-02-18 11:55:53 +11:00
|
|
|
WM_keymap_add_item(keymap, "ACTION_OT_view_all", NDOF_BUTTON_FIT, KM_PRESS, 0, 0);
|
2011-03-17 10:02:37 +00:00
|
|
|
WM_keymap_add_item(keymap, "ACTION_OT_view_selected", PADPERIOD, KM_PRESS, 0, 0);
|
2009-01-28 22:51:42 +00:00
|
|
|
|
2009-12-27 01:36:32 +00:00
|
|
|
/* animation module */
|
2012-05-08 16:02:13 +00:00
|
|
|
/* channels list
|
|
|
|
|
* NOTE: these operators were originally for the channels list, but are added here too for convenience...
|
|
|
|
|
*/
|
2009-12-27 01:36:32 +00:00
|
|
|
WM_keymap_add_item(keymap, "ANIM_OT_channels_editable_toggle", TABKEY, KM_PRESS, 0, 0);
|
|
|
|
|
|
2014-06-24 17:52:40 +12:00
|
|
|
/* find (i.e. a shortcut for setting the name filter) */
|
|
|
|
|
WM_keymap_add_item(keymap, "ANIM_OT_channels_find", FKEY, KM_PRESS, KM_CTRL, 0);
|
|
|
|
|
|
2008-12-29 07:19:16 +00:00
|
|
|
/* transform system */
|
Key Configuration
Keymaps are now saveable and configurable from the user preferences, note
that editing one item in a keymap means the whole keymap is now defined by
the user and will not be updated by Blender, an option for syncing might be
added later. The outliner interface is still there, but I will probably
remove it.
There's actually 3 levels now:
* Default builtin key configuration.
* Key configuration loaded from .py file, for configs like Blender 2.4x
or other 3D applications.
* Keymaps edited by the user and saved in .B.blend. These can be saved
to .py files as well to make creating distributable configurations
easier.
Also, user preferences sections were reorganized a bit, now there is:
Interface, Editing, Input, Files and System.
Implementation notes:
* wmKeyConfig was added which represents a key configuration containing
keymaps.
* wmKeymapItem was renamed to wmKeyMapItem for consistency with wmKeyMap.
* Modal maps are not wrapped yet.
* User preferences DNA file reading did not support newdataadr() yet,
added this now for reading keymaps.
* Key configuration related settings are now RNA wrapped.
* is_property_set and is_property_hidden python methods were added.
2009-10-08 18:40:03 +00:00
|
|
|
transform_keymap_for_space(keyconf, keymap, SPACE_ACTION);
|
2011-06-01 06:26:54 +00:00
|
|
|
|
|
|
|
|
/* special markers hotkeys for anim editors: see note in definition of this function */
|
|
|
|
|
ED_marker_keymap_animedit_conflictfree(keymap);
|
2008-12-23 11:02:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* --------------- */
|
|
|
|
|
|
Key Configuration
Keymaps are now saveable and configurable from the user preferences, note
that editing one item in a keymap means the whole keymap is now defined by
the user and will not be updated by Blender, an option for syncing might be
added later. The outliner interface is still there, but I will probably
remove it.
There's actually 3 levels now:
* Default builtin key configuration.
* Key configuration loaded from .py file, for configs like Blender 2.4x
or other 3D applications.
* Keymaps edited by the user and saved in .B.blend. These can be saved
to .py files as well to make creating distributable configurations
easier.
Also, user preferences sections were reorganized a bit, now there is:
Interface, Editing, Input, Files and System.
Implementation notes:
* wmKeyConfig was added which represents a key configuration containing
keymaps.
* wmKeymapItem was renamed to wmKeyMapItem for consistency with wmKeyMap.
* Modal maps are not wrapped yet.
* User preferences DNA file reading did not support newdataadr() yet,
added this now for reading keymaps.
* Key configuration related settings are now RNA wrapped.
* is_property_set and is_property_hidden python methods were added.
2009-10-08 18:40:03 +00:00
|
|
|
void action_keymap(wmKeyConfig *keyconf)
|
2008-12-23 11:02:39 +00:00
|
|
|
{
|
2009-09-17 21:36:02 +00:00
|
|
|
wmKeyMap *keymap;
|
2008-12-23 11:02:39 +00:00
|
|
|
|
|
|
|
|
/* channels */
|
2009-01-01 00:18:23 +00:00
|
|
|
/* Channels are not directly handled by the Action Editor module, but are inherited from the Animation module.
|
|
|
|
|
* All the relevant operations, keymaps, drawing, etc. can therefore all be found in that module instead, as these
|
2009-12-27 01:36:32 +00:00
|
|
|
* are all used for the Graph-Editor too.
|
2009-01-01 00:18:23 +00:00
|
|
|
*/
|
2008-12-23 11:02:39 +00:00
|
|
|
|
|
|
|
|
/* keyframes */
|
2012-03-24 02:51:46 +00:00
|
|
|
keymap = WM_keymap_find(keyconf, "Dopesheet", SPACE_ACTION, 0);
|
Key Configuration
Keymaps are now saveable and configurable from the user preferences, note
that editing one item in a keymap means the whole keymap is now defined by
the user and will not be updated by Blender, an option for syncing might be
added later. The outliner interface is still there, but I will probably
remove it.
There's actually 3 levels now:
* Default builtin key configuration.
* Key configuration loaded from .py file, for configs like Blender 2.4x
or other 3D applications.
* Keymaps edited by the user and saved in .B.blend. These can be saved
to .py files as well to make creating distributable configurations
easier.
Also, user preferences sections were reorganized a bit, now there is:
Interface, Editing, Input, Files and System.
Implementation notes:
* wmKeyConfig was added which represents a key configuration containing
keymaps.
* wmKeymapItem was renamed to wmKeyMapItem for consistency with wmKeyMap.
* Modal maps are not wrapped yet.
* User preferences DNA file reading did not support newdataadr() yet,
added this now for reading keymaps.
* Key configuration related settings are now RNA wrapped.
* is_property_set and is_property_hidden python methods were added.
2009-10-08 18:40:03 +00:00
|
|
|
action_keymap_keyframes(keyconf, keymap);
|
2008-12-23 11:02:39 +00:00
|
|
|
}
|
|
|
|
|
|