Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-12-28 18:58:45 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-12-28 18:58:45 +0400
commit45ac43946f2e6b944eef64938e7607ee9e641c6d (patch)
tree9a70c2cd0cf604f1eadd33fd4884a5a7a1a5ea24 /source/blender/blenloader
parentba6f211226190834003769fb8a8b15bda777e290 (diff)
files from bmesh now load in trunk, this way loading (2.64 (or whenever bmesh is merged)), wont crash 2.62.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/readfile.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index bdd9ba65ac5..8a14e9416df 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -3731,6 +3731,36 @@ static void direct_link_mesh(FileData *fd, Mesh *mesh)
direct_link_customdata(fd, &mesh->edata, mesh->totedge);
direct_link_customdata(fd, &mesh->fdata, mesh->totface);
+
+#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_mesh= NULL;