diff options
Diffstat (limited to 'source/blender/modifiers')
-rw-r--r-- | source/blender/modifiers/intern/MOD_meshsequencecache.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/source/blender/modifiers/intern/MOD_meshsequencecache.c b/source/blender/modifiers/intern/MOD_meshsequencecache.c index 355ac9563dd..cf137784e65 100644 --- a/source/blender/modifiers/intern/MOD_meshsequencecache.c +++ b/source/blender/modifiers/intern/MOD_meshsequencecache.c @@ -65,6 +65,7 @@ static void copyData(ModifierData *md, ModifierData *target) if (tmcmd->cache_file) { id_us_plus(&tmcmd->cache_file->id); + tmcmd->reader = NULL; } } @@ -75,6 +76,10 @@ static void freeData(ModifierData *md) if (mcmd->cache_file) { id_us_min(&mcmd->cache_file->id); } + + if (mcmd->reader) { + CacheReader_free(mcmd->reader); + } } static bool isDisabled(ModifierData *md, int UNUSED(useRenderParams)) @@ -102,10 +107,16 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, BKE_cachefile_ensure_handle(G.main, cache_file); - DerivedMesh *result = ABC_read_mesh(cache_file->handle, + if (!mcmd->reader) { + mcmd->reader = CacheReader_open_alembic_object(cache_file->handle, + mcmd->reader, + ob, + mcmd->object_path); + } + + DerivedMesh *result = ABC_read_mesh(mcmd->reader, ob, dm, - mcmd->object_path, time, &err_str, mcmd->read_flag); |