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:
authorJuha Mäki-Kanto <ih5235252@gmail.com>2012-05-02 20:18:20 +0400
committerJuha Mäki-Kanto <ih5235252@gmail.com>2012-05-02 20:18:20 +0400
commit66581e903c346e60797669693de99fd710806af6 (patch)
tree5f3d02748dbdfe8d33e8f468a48991cbd445043b /source/blender/collada/MeshImporter.cpp
parentade7f59d0a7163c14afaa0a5418698149d141d4b (diff)
Fix #31176: Collada model shows weird textures in editmode
Issue with multimaterial meshes and mface to mpoly conversion being before assignment of materials (which is done on meshobject instancing?). Added explicit bmesh conversion to MeshImporter which is called from DocumentImporter::import.
Diffstat (limited to 'source/blender/collada/MeshImporter.cpp')
-rw-r--r--source/blender/collada/MeshImporter.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/source/blender/collada/MeshImporter.cpp b/source/blender/collada/MeshImporter.cpp
index 73b2a1c23ad..d6cc35deca7 100644
--- a/source/blender/collada/MeshImporter.cpp
+++ b/source/blender/collada/MeshImporter.cpp
@@ -727,6 +727,16 @@ bool MeshImporter::flat_face(unsigned int *nind, COLLADAFW::MeshVertexData& nor,
MeshImporter::MeshImporter(UnitConverter *unitconv, ArmatureImporter *arm, Scene *sce) : unitconverter(unitconv), scene(sce), armature_importer(arm) {}
+void MeshImporter::bmeshConversion()
+{
+ for (std::map<COLLADAFW::UniqueId, Mesh*>::iterator m = uid_mesh_map.begin();
+ m != uid_mesh_map.end(); ++m)
+ {
+ if ((*m).second) BKE_mesh_convert_mfaces_to_mpolys((*m).second);
+ }
+}
+
+
Object *MeshImporter::get_object_by_geom_uid(const COLLADAFW::UniqueId& geom_uid)
{
if (uid_object_map.find(geom_uid) != uid_object_map.end())
@@ -921,7 +931,7 @@ Object *MeshImporter::create_mesh_object(COLLADAFW::Node *node, COLLADAFW::Insta
fprintf(stderr, "invalid referenced material for %s\n", mat_array[i].getName().c_str());
}
}
-
+
return ob;
}
@@ -964,6 +974,5 @@ bool MeshImporter::write_geometry(const COLLADAFW::Geometry* geom)
mesh_calc_normals_mapping(me->mvert, me->totvert, me->mloop, me->mpoly, me->totloop, me->totpoly, NULL, NULL, 0, NULL, NULL);
- BKE_mesh_convert_mfaces_to_mpolys(me);
return true;
}