diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-12-28 19:14:52 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-12-28 19:14:52 +0400 |
commit | ae2ff6fe476a489fba5683090c9885f56a658ec5 (patch) | |
tree | d0d625e0bb8c5de5e270a3fba63ebade24dd295e /source/blender/blenloader | |
parent | 74b3584181a5a40ea43f5be8173f998cf5df6f14 (diff) | |
parent | 6e94bdd8e433d2c7f250b1998ce5acaefd5bac5e (diff) |
svn merge ^/trunk/blender -r42935:42940
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 9695b90593b..8a124010216 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -3810,6 +3810,36 @@ static void direct_link_mesh(FileData *fd, Mesh *mesh) direct_link_customdata(fd, &mesh->ldata, mesh->totloop); direct_link_customdata(fd, &mesh->pdata, mesh->totpoly); + +#ifdef USE_BMESH_FORWARD_COMPAT + /* NEVER ENABLE THIS CODE INTO BMESH! + * THIS IS FOR LOADING BMESH INTO OLDER FILES ONLY */ + mesh->mpoly= newdataadr(fd, mesh->mpoly); + mesh->mloop= newdataadr(fd, mesh->mloop); + + direct_link_customdata(fd, &mesh->pdata, mesh->totpoly); + direct_link_customdata(fd, &mesh->ldata, mesh->totloop); + + if (mesh->mpoly) { + /* be clever and load polygons as mfaces */ + + mesh->totface= mesh_mpoly_to_mface(&mesh->fdata, &mesh->ldata, &mesh->pdata, + mesh->totface, mesh->totloop, mesh->totpoly); + + CustomData_free(&mesh->pdata, mesh->totpoly); + memset(&mesh->pdata, 0, sizeof(CustomData)); + mesh->totpoly = 0; + + CustomData_free(&mesh->ldata, mesh->totloop); + memset(&mesh->ldata, 0, sizeof(CustomData)); + mesh->totloop = 0; + + mesh_update_customdata_pointers(mesh); + } + +#endif + + mesh->bb= NULL; mesh->mselect = NULL; mesh->edit_btmesh= NULL; |