diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-04-11 04:29:21 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-04-11 04:29:21 +0400 |
commit | 728767bad74a56ea93dc77b812ce6e8e0366cced (patch) | |
tree | e1721334fa4e41819021fe80130c1eaed8c6a01a /source/blender/editors/animation/anim_channels.c | |
parent | 5836cba0a5ffcace5fcf101a8947b377799b3adb (diff) |
2.5 Drivers:
* Fixed bug with setting the active F-Curve
* UI for editing drivers now works
Diffstat (limited to 'source/blender/editors/animation/anim_channels.c')
-rw-r--r-- | source/blender/editors/animation/anim_channels.c | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/source/blender/editors/animation/anim_channels.c b/source/blender/editors/animation/anim_channels.c index 4d200ca392d..e0f760542d9 100644 --- a/source/blender/editors/animation/anim_channels.c +++ b/source/blender/editors/animation/anim_channels.c @@ -120,7 +120,6 @@ void ANIM_set_active_channel (void *data, short datatype, int filter, void *chan { ListBase anim_data = {NULL, NULL}; bAnimListElem *ale; - short smode; /* try to build list of filtered items */ // XXX we don't need/supply animcontext for now, since in this case, there's nothing really essential there that isn't already covered @@ -132,15 +131,7 @@ void ANIM_set_active_channel (void *data, short datatype, int filter, void *chan for (ale= anim_data.first; ale; ale= ale->next) { /* skip if types don't match */ if (channel_type != ale->type) - continue; - - /* flag setting mode - * - depends on whether the provided channel is encountered - */ - if (ale->data == channel_data) - smode= ACHANNEL_SETFLAG_ADD; - else - smode= ACHANNEL_SETFLAG_CLEAR; + continue; /* flag to set depends on type */ switch (ale->type) { @@ -148,14 +139,32 @@ void ANIM_set_active_channel (void *data, short datatype, int filter, void *chan { bActionGroup *agrp= (bActionGroup *)ale->data; - ACHANNEL_SET_FLAG(agrp, smode, AGRP_ACTIVE); + ACHANNEL_SET_FLAG(agrp, ACHANNEL_SETFLAG_CLEAR, AGRP_ACTIVE); } break; case ANIMTYPE_FCURVE: { FCurve *fcu= (FCurve *)ale->data; - ACHANNEL_SET_FLAG(fcu, smode, FCURVE_ACTIVE); + ACHANNEL_SET_FLAG(fcu, ACHANNEL_SETFLAG_CLEAR, FCURVE_ACTIVE); + } + break; + } + } + + /* set active flag */ + if (channel_data) { + switch (channel_type) { + case ANIMTYPE_GROUP: + { + bActionGroup *agrp= (bActionGroup *)channel_data; + agrp->flag |= AGRP_ACTIVE; + } + break; + case ANIMTYPE_FCURVE: + { + FCurve *fcu= (FCurve *)channel_data; + fcu->flag |= FCURVE_ACTIVE; } break; } |