Alembic import: assign cache_file handle to original datablock
This commit is contained in:
@@ -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)
|
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);
|
BLI_spin_lock(&spin);
|
||||||
if (cache_file->handle_mutex == NULL) {
|
if (cache_file->handle_mutex == NULL) {
|
||||||
cache_file->handle_mutex = BLI_mutex_alloc();
|
cache_file->handle_mutex = BLI_mutex_alloc();
|
||||||
|
@@ -103,7 +103,7 @@ static Mesh *applyModifier(
|
|||||||
const float time = BKE_cachefile_time_offset(mcmd->cache_file, frame, FPS);
|
const float time = BKE_cachefile_time_offset(mcmd->cache_file, frame, FPS);
|
||||||
const char *err_str = NULL;
|
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);
|
BKE_cachefile_ensure_handle(G.main, cache_file);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user