diff options
-rw-r--r-- | source/blender/editors/animation/anim_filter.c | 29 |
1 files changed, 27 insertions, 2 deletions
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; |