diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-03-05 22:05:06 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-03-05 22:05:06 +0400 |
commit | a5eadf14e03809f5b54803f97a4545c9719232ea (patch) | |
tree | 9c8c01014bd8ae09f96781c2b15d07650e15ac0d /source/blender/blenkernel/intern/mesh.c | |
parent | 03ebd2091b356d7ada33fe62e996d9d6f258c14d (diff) |
copying a mesh was generating tessfaces which isnt needed
Diffstat (limited to 'source/blender/blenkernel/intern/mesh.c')
-rw-r--r-- | source/blender/blenkernel/intern/mesh.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index 1d7d8a23107..708f85e0311 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -474,6 +474,7 @@ Mesh *copy_mesh(Mesh *me) MTFace *tface; MTexPoly *txface; int a, i; + const int do_tessface = ((me->totface != 0) && (me->totpoly == 0)); /* only do tessface if we have no polys */ men= copy_libblock(&me->id); @@ -485,10 +486,16 @@ Mesh *copy_mesh(Mesh *me) CustomData_copy(&me->vdata, &men->vdata, CD_MASK_MESH, CD_DUPLICATE, men->totvert); CustomData_copy(&me->edata, &men->edata, CD_MASK_MESH, CD_DUPLICATE, men->totedge); - CustomData_copy(&me->fdata, &men->fdata, CD_MASK_MESH, CD_DUPLICATE, men->totface); CustomData_copy(&me->ldata, &men->ldata, CD_MASK_MESH, CD_DUPLICATE, men->totloop); CustomData_copy(&me->pdata, &men->pdata, CD_MASK_MESH, CD_DUPLICATE, men->totpoly); - mesh_update_customdata_pointers(men, TRUE); + if (do_tessface) { + CustomData_copy(&me->fdata, &men->fdata, CD_MASK_MESH, CD_DUPLICATE, men->totface); + } + else { + BKE_mesh_tessface_clear(men); + } + + mesh_update_customdata_pointers(men, do_tessface); /* ensure indirect linked data becomes lib-extern */ for (i=0; i<me->fdata.totlayer; i++) { |