[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [13664] trunk/blender/source/blender: == Action Editor - Insert Key+ "Active Group" ==
Joshua Leung
aligorith at gmail.com
Wed Feb 13 07:43:32 CET 2008
Revision: 13664
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=13664
Author: aligorith
Date: 2008-02-13 07:43:31 +0100 (Wed, 13 Feb 2008)
Log Message:
-----------
== 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).
Modified Paths:
--------------
trunk/blender/source/blender/include/BSE_editaction_types.h
trunk/blender/source/blender/src/editaction.c
Modified: trunk/blender/source/blender/include/BSE_editaction_types.h
===================================================================
--- trunk/blender/source/blender/include/BSE_editaction_types.h 2008-02-13 03:44:44 UTC (rev 13663)
+++ trunk/blender/source/blender/include/BSE_editaction_types.h 2008-02-13 06:43:31 UTC (rev 13664)
@@ -73,7 +73,8 @@
ACTFILTER_CHANNELS = (1<<3), /* do we only care that it is a channel */
ACTFILTER_IPOKEYS = (1<<4), /* only channels referencing ipo's */
ACTFILTER_ONLYICU = (1<<5), /* only reference ipo-curves */
- ACTFILTER_FORDRAWING = (1<<6) /* make list for interface drawing */
+ ACTFILTER_FORDRAWING = (1<<6), /* make list for interface drawing */
+ ACTFILTER_ACTGROUPED = (1<<7) /* belongs to the active group */
} ACTFILTER_FLAGS;
/* Action Editor - Main Data types */
Modified: trunk/blender/source/blender/src/editaction.c
===================================================================
--- trunk/blender/source/blender/src/editaction.c 2008-02-13 03:44:44 UTC (rev 13663)
+++ trunk/blender/source/blender/src/editaction.c 2008-02-13 06:43:31 UTC (rev 13664)
@@ -406,24 +406,30 @@
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 @@
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);
More information about the Bf-blender-cvs
mailing list