From ed316ad8e967b85a79bb67b79ffc5e3cd90820a5 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sun, 21 Jun 2009 03:02:40 +0000 Subject: 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. --- source/blender/editors/space_nla/nla_ops.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/space_nla/nla_ops.c') 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); -- cgit v1.2.3