Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorSybren A. Stüvel <sybren@stuvel.eu>2018-06-08 14:52:18 +0300
committerSybren A. Stüvel <sybren@stuvel.eu>2018-06-08 14:52:53 +0300
commit0c7fc3a9618c2bd410c45953f49f836ee866502c (patch)
tree0d9e5d495df2d3df29d98cfc4edba51b8c1d029b /source
parentc5904574cbb6d659fbaf6a9b4fdeb2629b1547d1 (diff)
Alembic import: assign cache_file handle to original datablock
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/cachefile.c3
-rw-r--r--source/blender/modifiers/intern/MOD_meshsequencecache.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/cachefile.c b/source/blender/blenkernel/intern/cachefile.c
index 89c6fad086d..d0cdfd6aeed 100644
--- a/source/blender/blenkernel/intern/cachefile.c
+++ b/source/blender/blenkernel/intern/cachefile.c
@@ -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();
diff --git a/source/blender/modifiers/intern/MOD_meshsequencecache.c b/source/blender/modifiers/intern/MOD_meshsequencecache.c
index 5ebf67b8d5f..abd84799457 100644
--- a/source/blender/modifiers/intern/MOD_meshsequencecache.c
+++ b/source/blender/modifiers/intern/MOD_meshsequencecache.c
@@ -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);