diff options
author | Joshua Leung <aligorith@gmail.com> | 2010-07-05 08:37:30 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2010-07-05 08:37:30 +0400 |
commit | 05eb72ff141ad74b57504b7cf28b81548162d650 (patch) | |
tree | 5409a9949d46e79870ddb3880205c4f0d80f3208 /source/blender/editors | |
parent | faf1c9a4bb27dfdd843cc745707d15ab47ce8683 (diff) |
Bugfix #22030: Animation Editors and Layer Animation
Added new filtering option for animation editors (indicated as the 'ghost' toggle beside the 'select'(-ed only) toggle), which will include objects/bones that aren't visible (i.e. are hidden or on a hidden layer).
This should make it possible to edit such types of animation, and also prevent flickering as these channels come in/out of view.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/animation/anim_filter.c | 14 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_templates.c | 8 |
2 files changed, 14 insertions, 8 deletions
diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index fc960ffb402..a9c9830f07f 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -797,7 +797,7 @@ bAnimListElem *make_new_animlistelem (void *data, short datatype, void *owner, s /* ----------------------------------------- */ /* NOTE: when this function returns true, the F-Curve is to be skipped */ -static int skip_fcurve_selected_data(FCurve *fcu, ID *owner_id, int filter_mode) +static int skip_fcurve_selected_data(bDopeSheet *ads, FCurve *fcu, ID *owner_id, int filter_mode) { if (GS(owner_id->name) == ID_OB) { Object *ob= (Object *)owner_id; @@ -814,9 +814,8 @@ static int skip_fcurve_selected_data(FCurve *fcu, ID *owner_id, int filter_mode) /* check whether to continue or skip */ if ((pchan) && (pchan->bone)) { - /* if only visible channels, skip if bone not visible */ - // TODO: should we just do this always? - if (filter_mode & ANIMFILTER_VISIBLE) { + /* if only visible channels, skip if bone not visible unless user wants channels from hidden data too */ + if ((filter_mode & ANIMFILTER_VISIBLE) && !(ads->filterflag & ADS_FILTER_INCL_HIDDEN)) { bArmature *arm= (bArmature *)ob->data; if ((arm->layer & pchan->bone->layer) == 0) @@ -887,7 +886,7 @@ static FCurve *animdata_filter_fcurve_next (bDopeSheet *ads, FCurve *first, bAct * - 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(fcu, owner_id, filter_mode)) + if (skip_fcurve_selected_data(ads, fcu, owner_id, filter_mode)) continue; } @@ -2112,11 +2111,14 @@ static int animdata_filter_dopesheet (bAnimContext *ac, ListBase *anim_data, bDo /* firstly, check if object can be included, by the following factors: * - if only visible, must check for layer and also viewport visibility + * --> while tools may demand only visible, user setting takes priority + * as user option controls whether sets of channels get included while + * tool-flag takes into account collapsed/open channels too * - if only selected, must check if object is selected * - there must be animation data to edit */ // TODO: if cache is implemented, just check name here, and then - if (filter_mode & ANIMFILTER_VISIBLE) { + if ((filter_mode & ANIMFILTER_VISIBLE) && !(ads->filterflag & ADS_FILTER_INCL_HIDDEN)) { /* layer visibility - we check both object and base, since these may not be in sync yet */ if ((sce->lay & (ob->lay|base->lay))==0) continue; diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 261f83f9bbc..ae5f81a56a9 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -80,11 +80,15 @@ void uiTemplateDopeSheetFilter(uiLayout *layout, bContext *C, PointerRNA *ptr) uiLayout *row= layout; short nlaActive= ((sa) && (sa->spacetype==SPACE_NLA)); - /* more 'generic' filtering options */ + /* most 'generic' filtering options */ row= uiLayoutRow(layout, 1); uiItemR(row, ptr, "only_selected", 0, "", 0); - uiItemR(row, ptr, "display_transforms", 0, "", 0); // xxx: include in another position instead? + uiItemR(row, ptr, "display_hidden", 0, "", 0); + + /* object-level filtering options */ + row= uiLayoutRow(layout, 1); + uiItemR(row, ptr, "display_transforms", 0, "", 0); if (nlaActive) uiItemR(row, ptr, "include_missing_nla", 0, "", 0); |