Fix T59687: Crash when rendering animation
authorSergey Sharybin <sergey.vfx@gmail.com>
Fri, 21 Dec 2018 13:23:06 +0000 (14:23 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Fri, 21 Dec 2018 13:23:06 +0000 (14:23 +0100)
The issue was caused by shape keys datablock from evaluated mesh
being added to the main database.

This commit makes it so shape keys are not copied for the mesh
used as cage.

source/blender/blenkernel/intern/mesh_convert.c

index de131b9be47614951c2480eba5f31cb339b5267e..995a67e66593ee8cd9c831bb257843f1db87b7ca 100644 (file)
@@ -971,8 +971,8 @@ Mesh *BKE_mesh_new_from_object(
                        /* copies object and modifiers (but not the data) */
                        if (cage) {
                                /* copies the data */
-                               tmpmesh = BKE_mesh_copy(bmain, ob->data);
-
+                               Mesh *mesh = ob->data;
+                               BKE_id_copy_ex(bmain, &mesh->id, (ID **)&tmpmesh, 0, false);
                                /* XXX BKE_mesh_copy() already handles materials usercount. */
                                do_mat_id_data_us = false;
                        }