diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-05-05 15:40:42 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-05-05 15:40:42 +0400 |
commit | bb1f8d9586220446c4df6339554b6cb0af02f030 (patch) | |
tree | 8b0778b7f5e8eb18b7ce817e150efc949adcab22 /source/blender/editors/animation/anim_filter.c | |
parent | 19e27ce15b213bc7c888e4a57ad97faa5dbb4220 (diff) | |
parent | f1e3c31d4ffa86b695fddd45d9ccc6ce9ac62ea7 (diff) |
Merged changes in the trunk up to revision 46309.
Conflicts resolved:
source/blender/blenloader/intern/readfile.c
source/blender/editors/interface/resources.c
source/blender/editors/mesh/editmesh_tools.c
Diffstat (limited to 'source/blender/editors/animation/anim_filter.c')
-rw-r--r-- | source/blender/editors/animation/anim_filter.c | 56 |
1 files changed, 35 insertions, 21 deletions
diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index 5a5f3bae6cc..809b4c8d65e 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -261,7 +261,7 @@ static short nlaedit_get_context (bAnimContext *ac, SpaceNla *snla) * - AnimContext to write to is provided as pointer to var on stack so that we don't have * allocation/freeing costs (which are not that avoidable with channels). */ -short ANIM_animdata_context_getdata (bAnimContext *ac) +short ANIM_animdata_context_getdata(bAnimContext *ac) { SpaceLink *sl = ac->sl; short ok= 0; @@ -304,7 +304,7 @@ short ANIM_animdata_context_getdata (bAnimContext *ac) * allocation/freeing costs (which are not that avoidable with channels). * - Clears data and sets the information from Blender Context which is useful */ -short ANIM_animdata_get_context (const bContext *C, bAnimContext *ac) +short ANIM_animdata_get_context(const bContext *C, bAnimContext *ac) { ScrArea *sa= CTX_wm_area(C); ARegion *ar= CTX_wm_region(C); @@ -838,11 +838,14 @@ static bAnimListElem *make_new_animlistelem (void *data, short datatype, ID *own /* ----------------------------------------- */ -/* 'Only Selected' selected data filtering +/* 'Only Selected' selected data and/or 'Include Hidden' filtering * NOTE: when this function returns true, the F-Curve is to be skipped */ -static size_t skip_fcurve_selected_data (bDopeSheet *ads, FCurve *fcu, ID *owner_id, int filter_mode) +static short skip_fcurve_selected_data (bDopeSheet *ads, FCurve *fcu, ID *owner_id, int filter_mode) { + /* hidden items should be skipped if we only care about visible data, but we aren't interested in hidden stuff */ + short skip_hidden = (filter_mode & ANIMFILTER_DATA_VISIBLE) && !(ads->filterflag & ADS_FILTER_INCL_HIDDEN); + if (GS(owner_id->name) == ID_OB) { Object *ob= (Object *)owner_id; @@ -859,17 +862,22 @@ static size_t skip_fcurve_selected_data (bDopeSheet *ads, FCurve *fcu, ID *owner /* check whether to continue or skip */ if ((pchan) && (pchan->bone)) { /* if only visible channels, skip if bone not visible unless user wants channels from hidden data too */ - if ((filter_mode & ANIMFILTER_DATA_VISIBLE) && !(ads->filterflag & ADS_FILTER_INCL_HIDDEN)) { + if (skip_hidden) { bArmature *arm= (bArmature *)ob->data; + /* skipping - not visible on currently visible layers */ if ((arm->layer & pchan->bone->layer) == 0) return 1; - // TODO: manually hidden using flags + /* skipping - is currently hidden */ + if (pchan->bone->flag & BONE_HIDDEN_P) + return 1; } /* can only add this F-Curve if it is selected */ - if ((pchan->bone->flag & BONE_SELECTED) == 0) - return 1; + if (ads->filterflag & ADS_FILTER_ONLYSEL) { + if ((pchan->bone->flag & BONE_SELECTED) == 0) + return 1; + } } } } @@ -888,14 +896,16 @@ static size_t skip_fcurve_selected_data (bDopeSheet *ads, FCurve *fcu, ID *owner if (seq_name) MEM_freeN(seq_name); /* can only add this F-Curve if it is selected */ - if (seq==NULL || (seq->flag & SELECT)==0) - return 1; + if (ads->filterflag & ADS_FILTER_ONLYSEL) { + if ((seq == NULL) || (seq->flag & SELECT)==0) + return 1; + } } } else if (GS(owner_id->name) == ID_NT) { bNodeTree *ntree = (bNodeTree *)owner_id; - /* check for selected nodes */ + /* check for selected nodes */ if ((fcu->rna_path) && strstr(fcu->rna_path, "nodes")) { bNode *node; char *node_name; @@ -906,8 +916,10 @@ static size_t skip_fcurve_selected_data (bDopeSheet *ads, FCurve *fcu, ID *owner if (node_name) MEM_freeN(node_name); /* can only add this F-Curve if it is selected */ - if ((node) && (node->flag & NODE_SELECT)==0) - return 1; + if (ads->filterflag & ADS_FILTER_ONLYSEL) { + if ((node) && (node->flag & NODE_SELECT)==0) + return 1; + } } } return 0; @@ -954,17 +966,19 @@ static FCurve *animfilter_fcurve_next (bDopeSheet *ads, FCurve *first, bActionGr */ for (fcu= first; ((fcu) && (fcu->grp==grp)); fcu= fcu->next) { /* special exception for Pose-Channel/Sequence-Strip/Node Based F-Curves: - * - the 'Only Selected' data filter should be applied to Pose-Channel data too, but those are - * represented as F-Curves. The way the filter for objects worked was to be the first check - * after 'normal' visibility, so this is done first here too... + * - the 'Only Selected' and 'Include Hidden' data filters should be applied to sub-ID data which + * can be independently selected/hidden, such as Pose-Channels, Sequence Strips, and Nodes. + * Since these checks were traditionally done as first check for objects, we do the same here * - we currently use an 'approximate' method for getting these F-Curves that doesn't require * carefully checking the entire path * - this will also affect things like Drivers, and also works for Bone Constraints */ - if ( ((ads) && (ads->filterflag & ADS_FILTER_ONLYSEL)) && (owner_id) ) { - if (skip_fcurve_selected_data(ads, fcu, owner_id, filter_mode)) - continue; - } + 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; + } + } /* only include if visible (Graph Editor check, not channels check) */ if (!(filter_mode & ANIMFILTER_CURVE_VISIBLE) || (fcu->flag & FCURVE_VISIBLE)) { @@ -2271,7 +2285,7 @@ static size_t animdata_filter_remove_duplis (ListBase *anim_data) * will be placed for use. * filter_mode: how should the data be filtered - bitmapping accessed flags */ -size_t ANIM_animdata_filter (bAnimContext *ac, ListBase *anim_data, int filter_mode, void *data, short datatype) +size_t ANIM_animdata_filter(bAnimContext *ac, ListBase *anim_data, int filter_mode, void *data, short datatype) { size_t items = 0; |