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/blenkernel/intern/fcurve.c')
-rw-r--r--source/blender/blenkernel/intern/fcurve.c30
1 files changed, 22 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c
index 807a723685a..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"
@@ -45,7 +41,6 @@
#include "BLI_blenlib.h"
#include "BLI_math.h"
-#include "BLI_noise.h"
#include "BKE_fcurve.h"
#include "BKE_animsys.h"
@@ -53,12 +48,10 @@
#include "BKE_armature.h"
#include "BKE_curve.h"
#include "BKE_global.h"
-#include "BKE_idprop.h"
#include "BKE_object.h"
#include "BKE_utildefines.h"
#include "RNA_access.h"
-#include "RNA_types.h"
#ifndef DISABLE_PYTHON
#include "BPY_extern.h"
@@ -237,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.
@@ -1404,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*/
}