Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2009-05-31 15:14:50 +0400
committerJoshua Leung <aligorith@gmail.com>2009-05-31 15:14:50 +0400
commit33267f58581ea8f9d89028958c6e64a8d048d4db (patch)
tree5bd7494f65b9a3914a945926df92d303b659d0d2 /source/blender/editors/space_nla/nla_ops.c
parentc42eeddea491d6a79dbcc0b8b28386237085643d (diff)
NLA SoC: Basic selection operators
* Added click-select/left-right select and deselect all/invert all selection operators. For now, these basic operators will suffice (more advanced selection operators will be coded at a later stage). * Fixed a few bugs in DopeSheet found while coding the relevant tools for NLA. * Added custom border-select operator for NLA channels (since the standard one assumes negative direction channel order) * Added new API-method for NLA strips to check if the strip occurs within a given range, since this test needed to be performed in a few places... * Tweaked the NLA Editor View2D ranges a bit to give saner default sizing. This still isn't right yet though.
Diffstat (limited to 'source/blender/editors/space_nla/nla_ops.c')
-rw-r--r--source/blender/editors/space_nla/nla_ops.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/source/blender/editors/space_nla/nla_ops.c b/source/blender/editors/space_nla/nla_ops.c
index ea450a08475..167686c99f9 100644
--- a/source/blender/editors/space_nla/nla_ops.c
+++ b/source/blender/editors/space_nla/nla_ops.c
@@ -72,9 +72,11 @@ void nla_operatortypes(void)
{
/* channels */
WM_operatortype_append(NLA_OT_channels_click);
+ WM_operatortype_append(NLA_OT_channels_select_border);
/* select */
- // ...
+ WM_operatortype_append(NLAEDIT_OT_click_select);
+ WM_operatortype_append(NLAEDIT_OT_select_all_toggle);
}
/* ************************** registration - keymaps **********************************/
@@ -88,14 +90,14 @@ static void nla_keymap_channels (wmWindowManager *wm, ListBase *keymap)
WM_keymap_add_item(keymap, "NLA_OT_channels_click", LEFTMOUSE, KM_PRESS, 0, 0);
RNA_boolean_set(WM_keymap_add_item(keymap, "NLA_OT_channels_click", LEFTMOUSE, KM_PRESS, KM_SHIFT, 0)->ptr, "extend", 1);
+ /* borderselect */
+ WM_keymap_add_item(keymap, "NLA_OT_channels_select_border", BKEY, KM_PRESS, 0, 0);
+
/* General Animation Channels keymap (see anim_channels.c) ----------------------- */
/* deselect all */
WM_keymap_add_item(keymap, "ANIM_OT_channels_select_all_toggle", AKEY, KM_PRESS, 0, 0);
RNA_boolean_set(WM_keymap_add_item(keymap, "ANIM_OT_channels_select_all_toggle", IKEY, KM_PRESS, KM_CTRL, 0)->ptr, "invert", 1);
- /* borderselect */
- WM_keymap_add_item(keymap, "ANIM_OT_channels_select_border", BKEY, KM_PRESS, 0, 0);
-
/* settings */
WM_keymap_add_item(keymap, "ANIM_OT_channels_setting_toggle", WKEY, KM_PRESS, KM_SHIFT, 0);
WM_keymap_add_item(keymap, "ANIM_OT_channels_setting_enable", WKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0);
@@ -114,8 +116,19 @@ static void nla_keymap_channels (wmWindowManager *wm, ListBase *keymap)
static void nla_keymap_main (wmWindowManager *wm, ListBase *keymap)
{
- //wmKeymapItem *kmi;
+ wmKeymapItem *kmi;
+ /* selection */
+ /* click select */
+ WM_keymap_add_item(keymap, "NLAEDIT_OT_click_select", SELECTMOUSE, KM_PRESS, 0, 0);
+ kmi= WM_keymap_add_item(keymap, "NLAEDIT_OT_click_select", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0);
+ RNA_boolean_set(kmi->ptr, "extend", 1);
+ kmi= WM_keymap_add_item(keymap, "NLAEDIT_OT_click_select", SELECTMOUSE, KM_PRESS, KM_CTRL, 0);
+ RNA_enum_set(kmi->ptr, "left_right", NLAEDIT_LRSEL_TEST);
+
+ /* deselect all */
+ WM_keymap_add_item(keymap, "NLAEDIT_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0);
+ RNA_boolean_set(WM_keymap_add_item(keymap, "NLAEDIT_OT_select_all_toggle", IKEY, KM_PRESS, KM_CTRL, 0)->ptr, "invert", 1);
/* transform system */