diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-01-02 16:37:58 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-01-02 16:37:58 +0400 |
commit | 68c4368001db49bd3daab96352ca3b4fb7d04e1c (patch) | |
tree | a686d2959e8fa3a9a8ffe6fbe590401f746ae399 /source/blender/blenloader | |
parent | a0e42dc8ab93ae6a30b51803e796b566080abeba (diff) |
dont save MFace's from BMesh, this means they stay used but only for tessface cache.
also saves on undo memory and disk space.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index ecb655dbaf7..b621a740b66 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -1694,6 +1694,18 @@ static void write_meshs(WriteData *wd, ListBase *idbase) if(mesh->id.us>0 || wd->current) { /* write LibData */ if (!save_for_old_blender) { + +#ifdef USE_BMESH_SAVE_WITHOUT_MFACE + Mesh backup_mesh = {{0}}; + /* cache only - dont write */ + backup_mesh.mface = mesh->mface; + mesh->mface = NULL; + /* -- */ + backup_mesh.totface = mesh->totface; + mesh->totface = 0; + /* -- */ +#endif /* USE_BMESH_SAVE_WITHOUT_MFACE */ + writestruct(wd, ID_ME, "Mesh", 1, mesh); /* direct data */ @@ -1704,9 +1716,18 @@ static void write_meshs(WriteData *wd, ListBase *idbase) write_customdata(wd, &mesh->id, mesh->totvert, &mesh->vdata, -1, 0); write_customdata(wd, &mesh->id, mesh->totedge, &mesh->edata, -1, 0); + /* fdata is really a dummy - written so slots align */ write_customdata(wd, &mesh->id, mesh->totface, &mesh->fdata, -1, 0); write_customdata(wd, &mesh->id, mesh->totloop, &mesh->ldata, -1, 0); write_customdata(wd, &mesh->id, mesh->totpoly, &mesh->pdata, -1, 0); + +#ifdef USE_BMESH_SAVE_WITHOUT_MFACE + /* cache only - dont write */ + mesh->mface = backup_mesh.mface; + /* -- */ + mesh->totface = backup_mesh.totface; +#endif /* USE_BMESH_SAVE_WITHOUT_MFACE */ + } else { |