Fix T59687: Crash when rendering animation
[blender.git] / 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;
                        }