From 779078000603881d20c944dc0f8b101a07f6b751 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Wed, 17 Feb 2010 12:03:23 +0000 Subject: Animation Editors: DopeSheet filter for Object-level animation Added a new option to filter the out Object-level (i.e. transforms, object visibility/settings, and also bone animation) animation data from the channels list. As most of these settings are transforms, I've used the transform manipulator icon and named the RNA setting display_transforms. This is useful when trying to filter out only material animation data for example, as requested by Colin. --- source/blender/editors/animation/anim_filter.c | 29 ++++++++++++---------- .../editors/interface/interface_templates.c | 17 ++++++------- 2 files changed, 23 insertions(+), 23 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index 9f6f76dc3c1..2bd4ab34fa5 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -1667,7 +1667,7 @@ static int animdata_filter_dopesheet_ob (bAnimContext *ac, ListBase *anim_data, return items; /* Action, Drivers, or NLA */ - if (ob->adt) { + if (ob->adt && !(ads->filterflag & ADS_FILTER_NOOBJ)) { adt= ob->adt; ANIMDATA_FILTER_CASES(ob, { /* AnimData blocks - do nothing... */ }, @@ -2168,19 +2168,22 @@ static int animdata_filter_dopesheet (bAnimContext *ac, ListBase *anim_data, bDo /* check filters for datatypes */ /* object */ actOk= 0; + if (!(ads->filterflag & ADS_FILTER_NOOBJ)) { + ANIMDATA_FILTER_CASES(ob, + { + /* for the special AnimData blocks only case, we only need to add + * the block if it is valid... then other cases just get skipped (hence ok=0) + */ + ANIMDATA_ADD_ANIMDATA(ob); + actOk=0; + }, + actOk= 1;, + actOk= 1;, + actOk= 1;) + } + keyOk= 0; - ANIMDATA_FILTER_CASES(ob, - { - /* for the special AnimData blocks only case, we only need to add - * the block if it is valid... then other cases just get skipped (hence ok=0) - */ - ANIMDATA_ADD_ANIMDATA(ob); - actOk=0; - }, - actOk= 1;, - actOk= 1;, - actOk= 1;) - if (key) { + if ((key) && !(ads->filterflag & ADS_FILTER_NOSHAPEKEYS)) { /* shapekeys */ ANIMDATA_FILTER_CASES(key, { diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index c327d4515d3..6de11e9486e 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -77,26 +77,23 @@ void uiTemplateDopeSheetFilter(uiLayout *layout, bContext *C, PointerRNA *ptr) ScrArea *sa= CTX_wm_area(C); uiLayout *row= layout; short nlaActive= ((sa) && (sa->spacetype==SPACE_NLA)); - + /* more 'generic' filtering options */ - if (nlaActive) - row= uiLayoutRow(layout, 1); - + row= uiLayoutRow(layout, 1); + uiItemR(row, "", 0, ptr, "only_selected", 0); - + uiItemR(row, "", 0, ptr, "display_transforms", 0); // xxx: include in another position instead? + if (nlaActive) uiItemR(row, "", 0, ptr, "include_missing_nla", 0); - - if (nlaActive) - row= layout; - + /* datatype based - only available datatypes are shown */ row= uiLayoutRow(layout, 1); uiItemR(row, "", 0, ptr, "display_scene", 0); uiItemR(row, "", 0, ptr, "display_world", 0); uiItemR(row, "", 0, ptr, "display_node", 0); - + if (mainptr && mainptr->mesh.first) uiItemR(row, "", 0, ptr, "display_mesh", 0); if (mainptr && mainptr->key.first) -- cgit v1.2.3