From 8b192e1a6a5f985087949591d75e5757589ee16a Mon Sep 17 00:00:00 2001 From: Trevor Glauz <> Date: Thu, 10 Jan 2019 20:23:40 +0100 Subject: fix D4187: Collada Importer: Material assignment broken after importing Mesh with multiple materials --- source/blender/collada/MeshImporter.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'source/blender/collada') 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); -- cgit v1.2.3