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-06-21 07:02:40 +0400
committerJoshua Leung <aligorith@gmail.com>2009-06-21 07:02:40 +0400
commited316ad8e967b85a79bb67b79ffc5e3cd90820a5 (patch)
treedc7b9b16fa06d6d4cf9b91c52f1b23ba0f6329e7 /source/blender/editors/space_nla/nla_ops.c
parent6bca54aac17212f9c40b0a54a50a6c39e0817815 (diff)
NLA SoC: Fixes for Operator Poll Callbacks
* Clicking on NLA tracks while in TweakMode now works so that channels can be muted/protected/expanded as per usual. However, they cannot be selected, as changing the selection state can interfere with TweakMode state changes * Operators for animation channel-lists now use proper poll callbacks, which also take into account TweakMode where appropriate (i.e. all selection operators are now allowed to operate in NLA while in TweakMode, and all other operators will only work in Animation Editors) * Action Editor operators now use the poll callback for Action Editors/DopeSheet instead of the generic active-araa one.
Diffstat (limited to 'source/blender/editors/space_nla/nla_ops.c')
-rw-r--r--source/blender/editors/space_nla/nla_ops.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/source/blender/editors/space_nla/nla_ops.c b/source/blender/editors/space_nla/nla_ops.c
index 52b529661cb..df731e9d0fb 100644
--- a/source/blender/editors/space_nla/nla_ops.c
+++ b/source/blender/editors/space_nla/nla_ops.c
@@ -113,6 +113,14 @@ int nlaop_poll_tweakmode_on (bContext *C)
return 1;
}
+/* is tweakmode enabled - for use in NLA operator code */
+short nlaedit_is_tweakmode_on (bAnimContext *ac)
+{
+ if (ac && ac->scene)
+ return (ac->scene->flag & SCE_NLA_EDIT_ON);
+ return 0;
+}
+
/* ************************** registration - operator types **********************************/
void nla_operatortypes(void)
@@ -160,10 +168,10 @@ static void nla_keymap_channels (wmWindowManager *wm, ListBase *keymap)
/* General Animation Channels keymap (see anim_channels.c) ----------------------- */
/* selection */
- /* borderselect */
+ /* borderselect - not in tweakmode */
WM_keymap_add_item(keymap, "ANIM_OT_channels_select_border", BKEY, KM_PRESS, 0, 0);
- /* deselect all */
+ /* deselect all - not in tweakmode */
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);