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:
authorJoshua Leung <aligorith@gmail.com>2012-10-10 12:46:07 +0400
committerJoshua Leung <aligorith@gmail.com>2012-10-10 12:46:07 +0400
commitcc8c0d89e33613dcaa4398012d7786ee491a7510 (patch)
tree97058ccecd9cfcfd86ec0c2d6d1281bd678d7480 /source/blender/editors/animation
parent89969a07f0f665f83ef0cea6e2302f2237407196 (diff)
Graph Editor: Added a filtering option for Drivers mode to only show F-Curves
with errors This filtering option is useful when rigging and you want to figure out if any of your drivers are not functioning, and/or which one(s) are not, so that you can go through fixing them. It saves you from having to check on each one individually, or going into the console to try to infer which ones are not working.
Diffstat (limited to 'source/blender/editors/animation')
-rw-r--r--source/blender/editors/animation/anim_filter.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c
index 8b0593d48ac..d913779a883 100644
--- a/source/blender/editors/animation/anim_filter.c
+++ b/source/blender/editors/animation/anim_filter.c
@@ -980,6 +980,27 @@ static short skip_fcurve_with_name(bDopeSheet *ads, FCurve *fcu, ID *owner_id)
return 1;
}
+/* Check if F-Curve has errors and/or is disabled
+ * > returns: (bool) True if F-Curve has errors/is disabled
+ */
+static short fcurve_has_errors(FCurve *fcu)
+{
+ /* F-Curve disabled - path eval error */
+ if (fcu->flag & FCURVE_DISABLED) {
+ return 1;
+ }
+
+ /* driver? */
+ if (fcu->driver) {
+ /* for now, just check if the entire thing got disabled... */
+ if (fcu->driver->flag & DRIVER_FLAG_INVALID)
+ return 1;
+ }
+
+ /* no errors found */
+ return 0;
+}
+
/* find the next F-Curve that is usable for inclusion */
static FCurve *animfilter_fcurve_next(bDopeSheet *ads, FCurve *first, bActionGroup *grp, int filter_mode, ID *owner_id)
{
@@ -1018,6 +1039,13 @@ static FCurve *animfilter_fcurve_next(bDopeSheet *ads, FCurve *first, bActionGro
continue;
}
+ /* error-based filtering... */
+ if ((ads) && (ads->filterflag & ADS_FILTER_ONLY_ERRORS)) {
+ /* skip if no errors... */
+ if (fcurve_has_errors(fcu) == 0)
+ continue;
+ }
+
/* this F-Curve can be used, so return it */
return fcu;
}