diff options
author | Daniel Dunbar <daniel@zuster.org> | 2005-08-07 06:30:29 +0400 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2005-08-07 06:30:29 +0400 |
commit | 8da5df8887a315a9c92168c8dd81f11b6ee0b29b (patch) | |
tree | 2215d2dc26fe4fa4e006f414be78663099c4b59f /source/blender/blenkernel/intern/displist.c | |
parent | f17a9a1d3dec63bbf7da592616736212315a057a (diff) |
- add allowShared argument to DerivedMesh.convertToDispListMesh to allow returned
DLM to share data from DerivedMesh (reduces some copying/memory allocation)
- added displistmesh_copyShared function to copy a DLM but not duplicate any
internal data
- changed crease drawing to use DerivedMesh functions... this means varying
edge width style of creases had to go, I replaced by using varying color to
show crease weight instead. Don't think this is a big loss since the subsurf
result gives you a much better indication of the crease weight anyway.
- bug fix in mirror modifier, didn't copy edge creases from editmesh correctly
Diffstat (limited to 'source/blender/blenkernel/intern/displist.c')
-rw-r--r-- | source/blender/blenkernel/intern/displist.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index fa1d61bbf02..13a832e2e3d 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -137,6 +137,14 @@ DispListMesh *displistmesh_copy(DispListMesh *odlm) return ndlm; } +DispListMesh *displistmesh_copyShared(DispListMesh *odlm) +{ + DispListMesh *ndlm= MEM_dupallocN(odlm); + ndlm->dontFreeNors = ndlm->dontFreeOther = ndlm->dontFreeVerts = 1; + + return ndlm; +} + void displistmesh_to_mesh(DispListMesh *dlm, Mesh *me) { if (dlm->totvert>MESH_MAX_VERTS) { @@ -718,7 +726,7 @@ void mesh_create_shadedColors(Object *ob, int onlyForMesh, unsigned int **col1_r } else { dm = mesh_get_derived_final(ob, &dmNeedsFree); } - dlm= dm->convertToDispListMesh(dm); + dlm= dm->convertToDispListMesh(dm, 1); col1 = MEM_mallocN(sizeof(*col1)*dlm->totface*4, "col1"); if (col2_r && (me->flag & ME_TWOSIDED)) { |