diff options
Diffstat (limited to 'source/blender/blenkernel/intern/fcurve.c')
-rw-r--r-- | source/blender/blenkernel/intern/fcurve.c | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index 5bfef86b7c6..43f01199b69 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -34,10 +34,6 @@ #include <string.h> #include <float.h> -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - #include "MEM_guardedalloc.h" #include "DNA_anim_types.h" @@ -234,6 +230,27 @@ FCurve *list_find_fcurve (ListBase *list, const char rna_path[], const int array return NULL; } +/* quick way to loop over all fcurves of a given 'path' */ +FCurve *iter_step_fcurve (FCurve *fcu_iter, const char rna_path[]) +{ + FCurve *fcu; + + /* sanity checks */ + if (ELEM(NULL, fcu_iter, rna_path)) + return NULL; + + /* check paths of curves, then array indices... */ + for (fcu= fcu_iter; fcu; fcu= fcu->next) { + /* simple string-compare (this assumes that they have the same root...) */ + if (fcu->rna_path && !strcmp(fcu->rna_path, rna_path)) { + return fcu; + } + } + + /* return */ + return NULL; +} + /* Get list of LinkData's containing pointers to the F-Curves which control the types of data indicated * Lists... * - dst: list of LinkData's matching the criteria returned. @@ -1401,7 +1418,7 @@ static float evaluate_driver (ChannelDriver *driver, float evaltime) /* this evaluates the expression using Python,and returns its result: * - on errors it reports, then returns 0.0f */ - driver->curval= BPY_pydriver_eval(driver); + driver->curval= BPY_eval_driver(driver); } #endif /* DISABLE_PYTHON*/ } |