[Bf-blender-cvs] [09ea5dfd096] master: Fix assert in Alembic tests with constraints

Brecht Van Lommel noreply at git.blender.org
Tue Jul 2 18:09:34 CEST 2019


Commit: 09ea5dfd096ea4e9c2ed5c4d4b1fb4e56d7b6713
Author: Brecht Van Lommel
Date:   Tue Jul 2 14:34:19 2019 +0200
Branches: master
https://developer.blender.org/rB09ea5dfd096ea4e9c2ed5c4d4b1fb4e56d7b6713

Fix assert in Alembic tests with constraints

Leave the reader to be created on the CoW object in the depsgraph evaluation,
don't assign the one used for importing to the original object.

===================================================================

M	source/blender/alembic/intern/abc_object.cc
M	source/blender/blenkernel/intern/cachefile.c

===================================================================

diff --git a/source/blender/alembic/intern/abc_object.cc b/source/blender/alembic/intern/abc_object.cc
index e437273c1be..54450ce1cb2 100644
--- a/source/blender/alembic/intern/abc_object.cc
+++ b/source/blender/alembic/intern/abc_object.cc
@@ -263,9 +263,6 @@ void AbcObjectReader::setupObjectTransform(const float time)
 
     data->cache_file = m_settings->cache_file;
     id_us_plus(&data->cache_file->id);
-
-    data->reader = reinterpret_cast<CacheReader *>(this);
-    this->incref();
   }
 }
 
diff --git a/source/blender/blenkernel/intern/cachefile.c b/source/blender/blenkernel/intern/cachefile.c
index 272413ece4a..2d6256f12e2 100644
--- a/source/blender/blenkernel/intern/cachefile.c
+++ b/source/blender/blenkernel/intern/cachefile.c
@@ -100,11 +100,11 @@ void BKE_cachefile_reader_open(CacheFile *cache_file,
 void BKE_cachefile_reader_free(CacheFile *cache_file, struct CacheReader **reader)
 {
 #ifdef WITH_ALEMBIC
-  if (cache_file) {
-    BLI_assert(cache_file->id.tag & LIB_TAG_COPIED_ON_WRITE);
-  }
-
   if (*reader != NULL) {
+    if (cache_file) {
+      BLI_assert(cache_file->id.tag & LIB_TAG_COPIED_ON_WRITE);
+    }
+
     CacheReader_free(*reader);
     *reader = NULL;



More information about the Bf-blender-cvs mailing list