From f023fcf5354d2a2c95f358d9f5d0cacf7f45d4ec Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Sun, 20 Oct 2013 17:53:29 +0000 Subject: Project Pampa request: show curves for node grupps It was not implemented in anim filter yet. it's strictly speaking not so much clear how "selected only" mode is expected to work when having multiple node trees editing at the same time. For now all the animation data from selected group will be displayed. --- source/blender/editors/animation/anim_filter.c | 29 ++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/animation/anim_filter.c') diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index 09b6e7d2206..b7a1614146a 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -1503,8 +1503,7 @@ static size_t animdata_filter_mask(ListBase *anim_data, void *UNUSED(data), int } /* NOTE: owner_id is scene, material, or texture block, which is the direct owner of the node tree in question */ -// TODO: how to handle group nodes is still unclear... -static size_t animdata_filter_ds_nodetree(bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, ID *owner_id, bNodeTree *ntree, int filter_mode) +static size_t animdata_filter_ds_nodetree_group(bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, ID *owner_id, bNodeTree *ntree, int filter_mode) { ListBase tmp_data = {NULL, NULL}; size_t tmp_items = 0; @@ -1538,6 +1537,32 @@ static size_t animdata_filter_ds_nodetree(bAnimContext *ac, ListBase *anim_data, return items; } +static size_t animdata_filter_ds_nodetree(bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, ID *owner_id, bNodeTree *ntree, int filter_mode) +{ + bNode *node; + size_t items = 0; + int group_filter_mode = filter_mode & ~ADS_FILTER_ONLYSEL; + + items += animdata_filter_ds_nodetree_group(ac, anim_data, ads, owner_id, ntree, filter_mode); + + for (node = ntree->nodes.first; node; node = node->next) { + if (node->type == NODE_GROUP) { + if (node->id) { + int filterflag = ads->filterflag; + if ((filter_mode & ADS_FILTER_ONLYSEL) && (node->flag & NODE_SELECT) == 0) { + continue; + } + /* TODO(sergey): A bit creepy, but this flag is not used from threads anyway. */ + ads->filterflag &= ~ADS_FILTER_ONLYSEL; + items += animdata_filter_ds_nodetree_group(ac, anim_data, ads, owner_id, (bNodeTree *) node->id, group_filter_mode); + ads->filterflag = filterflag; + } + } + } + + return items; +} + static size_t animdata_filter_ds_linestyle(bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Scene *sce, int filter_mode) { SceneRenderLayer *srl; -- cgit v1.2.3