Alembic import: assign cache_file handle to original datablock

This commit is contained in:
2018-06-08 13:52:18 +02:00
parent c5904574cb
commit 0c7fc3a961
2 changed files with 4 additions and 1 deletions

View File

@@ -146,6 +146,9 @@ void BKE_cachefile_reload(const Main *bmain, CacheFile *cache_file)
void BKE_cachefile_ensure_handle(const Main *bmain, CacheFile *cache_file)
{
/* Assigning to a CoW copy is a bad idea; assign to the original instead. */
BLI_assert((cache_file->id.tag & LIB_TAG_COPIED_ON_WRITE) == 0);
BLI_spin_lock(&spin);
if (cache_file->handle_mutex == NULL) {
cache_file->handle_mutex = BLI_mutex_alloc();

View File

@@ -103,7 +103,7 @@ static Mesh *applyModifier(
const float time = BKE_cachefile_time_offset(mcmd->cache_file, frame, FPS);
const char *err_str = NULL;
CacheFile *cache_file = mcmd->cache_file;
CacheFile *cache_file = (CacheFile *)DEG_get_original_id(&mcmd->cache_file->id);
BKE_cachefile_ensure_handle(G.main, cache_file);