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_channels.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_channels.c')
-rw-r--r--source/blender/editors/space_nla/nla_channels.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/source/blender/editors/space_nla/nla_channels.c b/source/blender/editors/space_nla/nla_channels.c
index f928daa523b..a1c0de1e552 100644
--- a/source/blender/editors/space_nla/nla_channels.c
+++ b/source/blender/editors/space_nla/nla_channels.c
@@ -143,7 +143,7 @@ static void mouse_nla_channels (bAnimContext *ac, float x, int channel_index, sh
/* toggle expand */
ob->nlaflag ^= OB_ADS_COLLAPSED; // XXX
}
- else {
+ else if (nlaedit_is_tweakmode_on(ac) == 0) {
/* set selection status */
if (selectmode == SELECT_INVERT) {
/* swap select */
@@ -242,7 +242,7 @@ static void mouse_nla_channels (bAnimContext *ac, float x, int channel_index, sh
/* toggle 'solo' */
BKE_nlatrack_solo_toggle(adt, nlt);
}
- else {
+ else if (nlaedit_is_tweakmode_on(ac) == 0) {
/* set selection */
if (selectmode == SELECT_INVERT) {
/* inverse selection status of this F-Curve only */
@@ -266,10 +266,12 @@ static void mouse_nla_channels (bAnimContext *ac, float x, int channel_index, sh
/* for now, only do something if user clicks on the 'push-down' button */
if (x >= (NLACHANNEL_NAMEWIDTH-NLACHANNEL_BUTTON_WIDTH)) {
- /* activate push-down function */
- // TODO: make this use the operator instead of calling the function directly
- // however, calling the operator requires that we supply the args, and that works with proper buttons only
- BKE_nla_action_pushdown(adt);
+ /* activate push-down function - only usable when not in TweakMode */
+ if (nlaedit_is_tweakmode_on(ac) == 0) {
+ // TODO: make this use the operator instead of calling the function directly
+ // however, calling the operator requires that we supply the args, and that works with proper buttons only
+ BKE_nla_action_pushdown(adt);
+ }
}
}
break;
@@ -339,7 +341,7 @@ void NLA_OT_channels_click (wmOperatorType *ot)
/* api callbacks */
ot->invoke= nlachannels_mouseclick_invoke;
- ot->poll= nlaop_poll_tweakmode_off; // xxx?
+ ot->poll= ED_operator_nla_active;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;