[Bf-blender-cvs] [1f7c6fda5d1] id_copy_refactor: Fix wrong assert, and issue with Key ID freeing tag after copying from mesh...
Bastien Montagne
noreply at git.blender.org
Tue Jun 20 21:34:35 CEST 2017
Commit: 1f7c6fda5d160793c6bd4ce62c1d1d6eb95c59b0
Author: Bastien Montagne
Date: Tue Jun 20 21:20:43 2017 +0200
Branches: id_copy_refactor
https://developer.blender.org/rB1f7c6fda5d160793c6bd4ce62c1d1d6eb95c59b0
Fix wrong assert, and issue with Key ID freeing tag after copying from mesh...
===================================================================
M source/blender/blenkernel/intern/library.c
M source/blender/blenkernel/intern/mesh.c
===================================================================
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index 356f86cbca6..4f2adfef5e3 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -1171,7 +1171,7 @@ void BKE_libblock_copy_ex(Main *bmain, const ID *id, ID **r_newid, const int fla
BLI_assert((flag & LIB_ID_COPY_NO_MAIN) != 0 || bmain != NULL);
BLI_assert((flag & LIB_ID_COPY_NO_MAIN) != 0 || (flag & LIB_ID_COPY_NO_ALLOCATE) == 0);
- BLI_assert((flag & LIB_ID_COPY_NO_MAIN) != 0 || (flag & LIB_ID_COPY_NO_USER_REFCOUNT) == 0);
+ BLI_assert((flag & LIB_ID_COPY_NO_MAIN) == 0 || (flag & LIB_ID_COPY_NO_USER_REFCOUNT) != 0);
if ((flag & LIB_ID_COPY_NO_ALLOCATE) != 0) {
/* r_newid already contains pointer to allocated memory. */
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c
index 979da27cecf..3465c15f250 100644
--- a/source/blender/blenkernel/intern/mesh.c
+++ b/source/blender/blenkernel/intern/mesh.c
@@ -542,6 +542,7 @@ void BKE_mesh_copy_ex(Main *bmain, Mesh *me_dst, const Mesh *me_src, const int f
/* TODO Do we want to add flag to prevent this? */
if (me_src->key) {
BKE_id_copy_ex(bmain, &me_src->key->id, (ID **)&me_dst->key, flag, false);
+ me_dst->key->id.tag &= ~LIB_TAG_FREE_NO_USER_REFCOUNT; /* XXX Bad hack, to be solved better hopefully :( */
}
}
More information about the Bf-blender-cvs
mailing list