diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-12-26 16:46:54 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-12-26 16:50:22 +0400 |
commit | 6727bf3a215f014ea9e162e32968a7cb9be3077e (patch) | |
tree | 603f533af3f955373ab593fe88145f4a1b9ec8c6 /source/blender | |
parent | 05eebf49d3c3af47bf157207b82cf559ac1fe274 (diff) |
Avoid temporary change of animation data flags for nodes filter
Use temporary runtime flag of filter_mode argument instead.
This commit also fixes some weirdo mix of filter_mode with
filterflag bits.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/animation/anim_filter.c | 18 | ||||
-rw-r--r-- | source/blender/editors/include/ED_anim_api.h | 5 |
2 files changed, 12 insertions, 11 deletions
diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index ad745155286..5e93fda0cd4 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -1042,9 +1042,11 @@ static FCurve *animfilter_fcurve_next(bDopeSheet *ads, FCurve *first, bActionGro * - this will also affect things like Drivers, and also works for Bone Constraints */ if (ads && owner_id) { - if ((ads->filterflag & ADS_FILTER_ONLYSEL) || (ads->filterflag & ADS_FILTER_INCL_HIDDEN) == 0) { - if (skip_fcurve_selected_data(ads, fcu, owner_id, filter_mode)) - continue; + if ((filter_mode & ANIMFILTER_TMP_IGNORE_ONLYSEL) == 0) { + if ((ads->filterflag & ADS_FILTER_ONLYSEL) || (ads->filterflag & ADS_FILTER_INCL_HIDDEN) == 0) { + if (skip_fcurve_selected_data(ads, fcu, owner_id, filter_mode)) + continue; + } } } @@ -1541,21 +1543,17 @@ static size_t animdata_filter_ds_nodetree(bAnimContext *ac, ListBase *anim_data, { 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) { + if ((ads->filterflag & 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; + items += animdata_filter_ds_nodetree_group(ac, anim_data, ads, owner_id, (bNodeTree *) node->id, + filter_mode | ANIMFILTER_TMP_IGNORE_ONLYSEL); } } } diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h index 8b9bb0a4ab0..dff5069d991 100644 --- a/source/blender/editors/include/ED_anim_api.h +++ b/source/blender/editors/include/ED_anim_api.h @@ -225,7 +225,10 @@ typedef enum eAnimFilter_Flags { ANIMFILTER_NODUPLIS = (1 << 11), /* for checking if we should keep some collapsed channel around (internal use only!) */ - ANIMFILTER_TMP_PEEK = (1 << 30) + ANIMFILTER_TMP_PEEK = (1 << 30), + + /* ignore ONLYSEL flag from filterflag, (internal use only!) */ + ANIMFILTER_TMP_IGNORE_ONLYSEL = (1 << 31) } eAnimFilter_Flags; /* ---------- Flag Checking Macros ------------ */ |