Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/animation/anim_filter.c')
-rw-r--r--source/blender/editors/animation/anim_filter.c59
1 files changed, 38 insertions, 21 deletions
diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c
index 38b702f81e0..74b93089bc0 100644
--- a/source/blender/editors/animation/anim_filter.c
+++ b/source/blender/editors/animation/anim_filter.c
@@ -413,7 +413,9 @@ short ANIM_animdata_get_context (const bContext *C, bAnimContext *ac)
}\
}
-
+/* quick macro to test if an anim-channel representing an AnimData block is suitably active */
+#define ANIMCHANNEL_ACTIVEOK(ale) \
+ ( !(filter_mode & ANIMFILTER_ACTIVE) || !(ale->adt) || (ale->adt->flag & ADT_UI_ACTIVE) )
/* quick macro to test if an anim-channel (F-Curve, Group, etc.) is selected in an acceptable way */
#define ANIMCHANNEL_SELOK(test_func) \
@@ -980,10 +982,13 @@ static int animdata_filter_dopesheet_mats (ListBase *anim_data, bDopeSheet *ads,
/* include material-expand widget? */
// hmm... do we need to store the index of this material in the array anywhere?
if (filter_mode & ANIMFILTER_CHANNELS) {
- ale= make_new_animlistelem(ma, ANIMTYPE_DSMAT, base, ANIMTYPE_OBJECT, (ID *)ma);
- if (ale) {
- BLI_addtail(anim_data, ale);
- items++;
+ /* check if filtering by active status */
+ if ANIMCHANNEL_ACTIVEOK(ma) {
+ ale= make_new_animlistelem(ma, ANIMTYPE_DSMAT, base, ANIMTYPE_OBJECT, (ID *)ma);
+ if (ale) {
+ BLI_addtail(anim_data, ale);
+ items++;
+ }
}
}
@@ -1037,11 +1042,14 @@ static int animdata_filter_dopesheet_particles (ListBase *anim_data, bDopeSheet
/* add particle settings? */
if (FILTER_PART_OBJC(ob) || (filter_mode & ANIMFILTER_CURVESONLY)) {
- if ((filter_mode & ANIMFILTER_CHANNELS)){
- ale = make_new_animlistelem(psys->part, ANIMTYPE_DSPART, base, ANIMTYPE_OBJECT, (ID *)psys->part);
- if (ale) {
- BLI_addtail(anim_data, ale);
- items++;
+ if ((filter_mode & ANIMFILTER_CHANNELS)) {
+ /* check if filtering by active status */
+ if ANIMCHANNEL_ACTIVEOK(psys->part) {
+ ale = make_new_animlistelem(psys->part, ANIMTYPE_DSPART, base, ANIMTYPE_OBJECT, (ID *)psys->part);
+ if (ale) {
+ BLI_addtail(anim_data, ale);
+ items++;
+ }
}
}
@@ -1117,9 +1125,12 @@ static int animdata_filter_dopesheet_obdata (ListBase *anim_data, bDopeSheet *ad
expanded= EXPANDED_DRVD(adt);
/* include data-expand widget? */
- if ((filter_mode & ANIMFILTER_CURVESONLY) == 0) {
- ale= make_new_animlistelem(iat, type, base, ANIMTYPE_OBJECT, (ID *)iat);
- if (ale) BLI_addtail(anim_data, ale);
+ if ((filter_mode & ANIMFILTER_CURVESONLY) == 0) {
+ /* check if filtering by active status */
+ if ANIMCHANNEL_ACTIVEOK(iat) {
+ ale= make_new_animlistelem(iat, type, base, ANIMTYPE_OBJECT, (ID *)iat);
+ if (ale) BLI_addtail(anim_data, ale);
+ }
}
/* add object-data animation channels? */
@@ -1149,10 +1160,13 @@ static int animdata_filter_dopesheet_ob (ListBase *anim_data, bDopeSheet *ads, B
if ((filter_mode & (ANIMFILTER_CURVESONLY|ANIMFILTER_NLATRACKS)) == 0) {
/* check if filtering by selection */
if ANIMCHANNEL_SELOK((base->flag & SELECT)) {
- ale= make_new_animlistelem(base, ANIMTYPE_OBJECT, NULL, ANIMTYPE_NONE, NULL);
- if (ale) {
- BLI_addtail(anim_data, ale);
- items++;
+ /* check if filtering by active status */
+ if ANIMCHANNEL_ACTIVEOK(ob) {
+ ale= make_new_animlistelem(base, ANIMTYPE_OBJECT, NULL, ANIMTYPE_NONE, (ID *)ob);
+ if (ale) {
+ BLI_addtail(anim_data, ale);
+ items++;
+ }
}
}
}
@@ -1233,10 +1247,13 @@ static int animdata_filter_dopesheet_ob (ListBase *anim_data, bDopeSheet *ads, B
{ /* action (keyframes) */
/* include shapekey-expand widget? */
if ((filter_mode & ANIMFILTER_CHANNELS) && !(filter_mode & ANIMFILTER_CURVESONLY)) {
- ale= make_new_animlistelem(key, ANIMTYPE_DSSKEY, base, ANIMTYPE_OBJECT, (ID *)ob);
- if (ale) {
- BLI_addtail(anim_data, ale);
- items++;
+ /* check if filtering by active status */
+ if ANIMCHANNEL_ACTIVEOK(key) {
+ ale= make_new_animlistelem(key, ANIMTYPE_DSSKEY, base, ANIMTYPE_OBJECT, (ID *)ob);
+ if (ale) {
+ BLI_addtail(anim_data, ale);
+ items++;
+ }
}
}