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>2011-06-30 17:56:47 +0400
committerJoshua Leung <aligorith@gmail.com>2011-06-30 17:56:47 +0400
commita6270b0204b2a9424eaa51d475aa761d77f43a69 (patch)
tree92467389c658f50240228583f4d708a68467a243 /source/blender/editors/animation/anim_filter.c
parent2a85eff40cba602cb07aeb43c1af672ce2945bbb (diff)
Animation Channels Filtering Refactor - Part 5
Channels can now be used as "animation containers" to be filtered further to obtain a set of subsidiary channels (i.e. F-Curves associated with some summary channel). The main use of this is that object and scene summary channels can now be defined without defining the filtering logic in three different places - once for channel filtering, once for drawing keyframes in action editor, and once for editing these keyframes. An indirect consequence of this, is that the "Only selected channels" option in Timeline will now result in only the keyframes for a selected bones getting shown (when enabled), instead of all keyframes for the active object. This was requested by Lee during Durian, and is something which has only become possible as a result of this commit.
Diffstat (limited to 'source/blender/editors/animation/anim_filter.c')
-rw-r--r--source/blender/editors/animation/anim_filter.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c
index a7117af2151..b7264ae9a3e 100644
--- a/source/blender/editors/animation/anim_filter.c
+++ b/source/blender/editors/animation/anim_filter.c
@@ -127,6 +127,9 @@ static Key *actedit_get_shapekeys (bAnimContext *ac)
/* Get data being edited in Action Editor (depending on current 'mode') */
static short actedit_get_context (bAnimContext *ac, SpaceAction *saction)
{
+ /* get dopesheet */
+ ac->ads = &saction->ads;
+
/* sync settings with current view status, then return appropriate data */
switch (saction->mode) {
case SACTCONT_ACTION: /* 'Action Editor' */
@@ -190,6 +193,7 @@ static short graphedit_get_context (bAnimContext *ac, SpaceIpo *sipo)
sipo->ads= MEM_callocN(sizeof(bDopeSheet), "GraphEdit DopeSheet");
sipo->ads->source= (ID *)ac->scene;
}
+ ac->ads = sipo->ads;
/* set settings for Graph Editor - "Selected = Editable" */
if (sipo->flag & SIPO_SELCUVERTSONLY)
@@ -238,6 +242,7 @@ static short nlaedit_get_context (bAnimContext *ac, SpaceNla *snla)
/* init dopesheet data if non-existant (i.e. for old files) */
if (snla->ads == NULL)
snla->ads= MEM_callocN(sizeof(bDopeSheet), "NlaEdit DopeSheet");
+ ac->ads = snla->ads;
/* sync settings with current view status, then return appropriate data */
/* update scene-pointer (no need to check for pinning yet, as not implemented) */
@@ -2038,6 +2043,32 @@ static short animdata_filter_dopesheet_summary (bAnimContext *ac, ListBase *anim
return 1;
}
+/* ......................... */
+
+/* filter data associated with a channel - usually for handling summary-channels in DopeSheet */
+static size_t animdata_filter_animchan (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, bAnimListElem *channel, int filter_mode)
+{
+ size_t items = 0;
+
+ /* data to filter depends on channel type */
+ // XXX: only common channel-types have been handled for now
+ switch (channel->type) {
+ case ANIMTYPE_SUMMARY:
+ items += animdata_filter_dopesheet(ac, anim_data, ads, filter_mode);
+ break;
+
+ case ANIMTYPE_SCENE:
+ items += animdata_filter_dopesheet_scene(ac, anim_data, ads, channel->data, filter_mode);
+ break;
+
+ case ANIMTYPE_OBJECT:
+ items += animdata_filter_dopesheet_ob(ac, anim_data, ads, channel->data, filter_mode);
+ break;
+ }
+
+ return items;
+}
+
/* ----------- Cleanup API --------------- */
/* Remove entries with invalid types in animation channel list */
@@ -2157,6 +2188,15 @@ size_t ANIM_animdata_filter (bAnimContext *ac, ListBase *anim_data, int filter_m
items = animdata_filter_dopesheet(ac, anim_data, data, filter_mode);
}
break;
+
+ case ANIMCONT_CHANNEL: /* animation channel */
+ {
+ bDopeSheet *ads = ac->ads;
+
+ /* based on the channel type, filter relevant data for this */
+ items = animdata_filter_animchan(ac, anim_data, ads, data, filter_mode);
+ }
+ break;
}
/* remove any 'weedy' entries */