From 753edafcb77d9aaf07fe869372319b841dd80681 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dietrich?= Date: Sat, 29 Oct 2016 12:23:09 +0200 Subject: Alembic: store a pointer to the object reader in the cache modifiers and constraints. This avoids traversing the archive everytime object data is needed and gives an overall consistent ~2x speedup here with files containing between 136 and 500 Alembic objects. Also this somewhat nicely de- duplicates code between data creation (upon import) and data streaming (modifiers and constraints). The only worying part is what happens when a CacheFile is deleted and/or has its path changed. For now, we traverse the whole scene and for each object using the CacheFile we free the pointer and NULL-ify it (see BKE_cachefile_clean), but at some point this should be re-considered and make use of the dependency graph. --- source/blender/blenkernel/BKE_cachefile.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/blender/blenkernel/BKE_cachefile.h') diff --git a/source/blender/blenkernel/BKE_cachefile.h b/source/blender/blenkernel/BKE_cachefile.h index a55cb51766c..7e1c069df9a 100644 --- a/source/blender/blenkernel/BKE_cachefile.h +++ b/source/blender/blenkernel/BKE_cachefile.h @@ -63,6 +63,8 @@ bool BKE_cachefile_filepath_get( float BKE_cachefile_time_offset(struct CacheFile *cache_file, const float time, const float fps); +void BKE_cachefile_clean(struct Scene *scene, struct CacheFile *cache_file); + #ifdef __cplusplus } #endif -- cgit v1.2.3