diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-03-26 05:08:07 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-03-26 05:37:40 +0300 |
commit | ff017df318d5e2dce8c918735e363c0e43458a7c (patch) | |
tree | 859ccb5ef57c805a214db6e6804f891cb51a167c /source/blender/blenkernel/BKE_fcurve.h | |
parent | 6fd799c72c847f01b3fe0285ffded4055c83becc (diff) |
Animation: add BKE_fcurve_pathcache_find API
Support a cache for fast RNA path look-ups for RNA-path + index.
Unlike a regular hash lookup, this supports using a single lookup
for the RNA path which is then used to fill an array of F-curves.
Reviewed By: sybren
Ref D10781
Diffstat (limited to 'source/blender/blenkernel/BKE_fcurve.h')
-rw-r--r-- | source/blender/blenkernel/BKE_fcurve.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_fcurve.h b/source/blender/blenkernel/BKE_fcurve.h index ad9064fdfde..589d1839dd4 100644 --- a/source/blender/blenkernel/BKE_fcurve.h +++ b/source/blender/blenkernel/BKE_fcurve.h @@ -232,6 +232,19 @@ int BKE_fcurve_bezt_binarysearch_index(struct BezTriple array[], int arraylen, bool *r_replace); +/* fcurve_cache.c */ +/* Cached f-curve look-ups, use when this needs to be done many times. */ +struct FCurvePathCache; +struct FCurvePathCache *BKE_fcurve_pathcache_create(ListBase *list); +void BKE_fcurve_pathcache_destroy(struct FCurvePathCache *fcache); +struct FCurve *BKE_fcurve_pathcache_find(struct FCurvePathCache *fcache, + const char rna_path[], + const int array_index); +int BKE_fcurve_pathcache_find_array(struct FCurvePathCache *fcache, + const char *rna_path, + struct FCurve **fcurve_result, + int fcurve_result_len); + /* get the time extents for F-Curve */ bool BKE_fcurve_calc_range( struct FCurve *fcu, float *min, float *max, const bool do_sel_only, const bool do_min_length); |