diff options
author | Trevor Glauz <> | 2019-01-10 22:23:40 +0300 |
---|---|---|
committer | Gaia Clary <gaia.clary@machinimatrix.org> | 2019-01-10 22:24:56 +0300 |
commit | 8b192e1a6a5f985087949591d75e5757589ee16a (patch) | |
tree | 4f843f5d4011481374d8a58ff0352301897ad26a /source/blender/collada/MeshImporter.cpp | |
parent | bf7a1ef11e5b5b9054e43fe791b4cf95506fd7b9 (diff) |
fix D4187: Collada Importer: Material assignment broken after importing Mesh with multiple materials
Diffstat (limited to 'source/blender/collada/MeshImporter.cpp')
-rw-r--r-- | source/blender/collada/MeshImporter.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/source/blender/collada/MeshImporter.cpp b/source/blender/collada/MeshImporter.cpp index 4dd3f1cc219..069215da2b7 100644 --- a/source/blender/collada/MeshImporter.cpp +++ b/source/blender/collada/MeshImporter.cpp @@ -15,7 +15,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * Contributor(s): Chingiz Dyussenov, Arystanbek Dyussenov, Nathan Letwory. + * Contributor(s): Chingiz Dyussenov, Arystanbek Dyussenov, Nathan Letwory, Trevor Glauz. * * ***** END GPL LICENSE BLOCK ***** */ @@ -1123,6 +1123,9 @@ Object *MeshImporter::create_mesh_object(COLLADAFW::Node *node, COLLADAFW::Insta } } + // clean up the mesh + BKE_mesh_validate((Mesh *)ob->data, false, false); + return ob; } @@ -1154,13 +1157,7 @@ bool MeshImporter::write_geometry(const COLLADAFW::Geometry *geom) read_vertices(mesh, me); read_polys(mesh, me); - - // must validate before calculating edges - BKE_mesh_calc_normals(me); - BKE_mesh_validate(me, false, false); - // validation does this - // BKE_mesh_calc_edges(me, false, false); - + BKE_mesh_calc_edges(me, false, false); // read_lines() must be called after the face edges have been generated. // Otherwise the loose edges will be silently deleted again. read_lines(mesh, me); |