diff options
author | Joshua Leung <aligorith@gmail.com> | 2008-02-13 09:43:31 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2008-02-13 09:43:31 +0300 |
commit | 0f68741217b45b1becf1f50fd4763f0ca6b61b82 (patch) | |
tree | 2cc900bb447d67829a17aa04b6f903b7bd9e7f05 /source/blender/src/editaction.c | |
parent | 60378a306c5634a4f649be3f3497da80f0b5d899 (diff) |
== Action Editor - Insert Key+ "Active Group" ==
"Insert Key" menu in Action Editor (IKEY) now has a new option: "In Active Group". This only inserts keyframes in the active action group (if available).
Diffstat (limited to 'source/blender/src/editaction.c')
-rw-r--r-- | source/blender/src/editaction.c | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/source/blender/src/editaction.c b/source/blender/src/editaction.c index f52dea06f35..9cb2982f422 100644 --- a/source/blender/src/editaction.c +++ b/source/blender/src/editaction.c @@ -406,24 +406,30 @@ static void actdata_filter_action (ListBase *act_data, bAction *act, int filter_ if (agrp->channels.last) lastchan= agrp->channels.last; - /* filters here are a bit convulted... - * - groups show a "summary" of keyframes beside their name which must accessable for tools which handle keyframes - * - groups can be collapsed (and those tools which are only interested in channels rely on knowing that group is closed) - */ - if (!(filter_mode & ACTFILTER_VISIBLE) || EXPANDED_AGRP(agrp) || - (filter_mode & (ACTFILTER_IPOKEYS|ACTFILTER_ONLYICU))) - { - if (!(filter_mode & ACTFILTER_FOREDIT) || EDITABLE_AGRP(agrp)) { - for (achan= agrp->channels.first; achan && achan->grp==agrp; achan= achan->next) { - actdata_filter_actionchannel(act_data, achan, filter_mode); + + /* there are some situations, where only the channels of the active group should get considered */ + if (!(filter_mode & ACTFILTER_ACTGROUPED) || (agrp->flag & AGRP_ACTIVE)) { + /* filters here are a bit convoulted... + * - groups show a "summary" of keyframes beside their name which must accessable for tools which handle keyframes + * - groups can be collapsed (and those tools which are only interested in channels rely on knowing that group is closed) + */ + if ( (!(filter_mode & ACTFILTER_VISIBLE) || EXPANDED_AGRP(agrp)) || + (filter_mode & (ACTFILTER_IPOKEYS|ACTFILTER_ONLYICU)) ) + { + if (!(filter_mode & ACTFILTER_FOREDIT) || EDITABLE_AGRP(agrp)) { + for (achan= agrp->channels.first; achan && achan->grp==agrp; achan= achan->next) { + actdata_filter_actionchannel(act_data, achan, filter_mode); + } } } } } - /* loop over action channels */ - for (achan=(lastchan)?lastchan->next:act->chanbase.first; achan; achan=achan->next) { - actdata_filter_actionchannel(act_data, achan, filter_mode); + /* loop over un-grouped action channels (only if we're not only considering those channels in the active group) */ + if (!(filter_mode & ACTFILTER_ACTGROUPED)) { + for (achan=(lastchan)?lastchan->next:act->chanbase.first; achan; achan=achan->next) { + actdata_filter_actionchannel(act_data, achan, filter_mode); + } } } @@ -1369,12 +1375,13 @@ void insertkey_action(void) int filter; /* ask user what to keyframe */ - mode = pupmenu("Insert Key%t|All Channels%x1|Only Selected Channels%x2"); + mode = pupmenu("Insert Key%t|All Channels%x1|Only Selected Channels%x2|In Active Group%x3"); if (mode <= 0) return; /* filter data */ filter= (ACTFILTER_VISIBLE | ACTFILTER_FOREDIT | ACTFILTER_ONLYICU ); if (mode == 2) filter |= ACTFILTER_SEL; + if (mode == 3) filter |= ACTFILTER_ACTGROUPED; actdata_filter(&act_data, filter, data, datatype); |