diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-02-18 22:00:23 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-03-13 15:46:55 +0300 |
commit | a1a7317f6b098ab6928f33754e57de219877cb64 (patch) | |
tree | d14b44056f99d292567fe82c39d6f8d14e6f634d /source/blender/blenkernel/intern/mesh.c | |
parent | 2ef2f085fb743c12d1cabd71d42dd00334de696b (diff) |
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
Diffstat (limited to 'source/blender/blenkernel/intern/mesh.c')
-rw-r--r-- | source/blender/blenkernel/intern/mesh.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index 7757babaca2..809d2137187 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -1501,7 +1501,7 @@ void BKE_mesh_from_nurbs_displist(Object *ob, ListBase *dispbase, const bool use } else { me = BKE_mesh_add(G.main, "Mesh"); - DM_to_mesh(dm, me, ob, CD_MASK_MESH); + DM_to_mesh(dm, me, ob, CD_MASK_MESH, false); } me->totcol = cu->totcol; @@ -2256,8 +2256,7 @@ Mesh *BKE_mesh_new_from_object( dm = mesh_create_derived_view(sce, ob, mask); tmpmesh = BKE_mesh_add(bmain, "Mesh"); - DM_to_mesh(dm, tmpmesh, ob, mask); - dm->release(dm); + DM_to_mesh(dm, tmpmesh, ob, mask, true); } /* BKE_mesh_add/copy gives us a user count we don't need */ |