From a1a7317f6b098ab6928f33754e57de219877cb64 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 19 Feb 2015 00:00:23 +0500 Subject: Add argument to DM_to_mesh() function to take ownership over the DM The idea is pretty simple: instead of making temporary copy of all the related custom data layers just pass the ownership from the DM to the mesh. This is really handy in cases when you've got DM which you need to convert to Mesh datablock and wouldn't need that DM after conversion anyway. Foe example, render database conversion, exporters and even Modifier Apply will benefit from this option. Reviewers: campbellbarton Differential Revision: https://developer.blender.org/D1127 --- source/blender/collada/collada_utils.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source/blender/collada/collada_utils.cpp') diff --git a/source/blender/collada/collada_utils.cpp b/source/blender/collada/collada_utils.cpp index d91689ff496..f15efa89ea6 100644 --- a/source/blender/collada/collada_utils.cpp +++ b/source/blender/collada/collada_utils.cpp @@ -164,8 +164,7 @@ Mesh *bc_get_mesh_copy(Scene *scene, Object *ob, BC_export_mesh_type export_mesh } tmpmesh = BKE_mesh_add(G.main, "ColladaMesh"); // name is not important here - DM_to_mesh(dm, tmpmesh, ob, CD_MASK_MESH); - dm->release(dm); + DM_to_mesh(dm, tmpmesh, ob, CD_MASK_MESH, true); if (triangulate) { bc_triangulate_mesh(tmpmesh); -- cgit v1.2.3