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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2012-05-03 03:36:34 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2012-05-03 03:36:34 +0400
commit959a717d914c27d9b3f3030730bf4360ac3dcf1a (patch)
treeaed329a5db7b46c582c8c7b057b7148732043ff6 /source/blender/collada/MeshImporter.cpp
parent893cd1b4fd13b3324f383363bebd466ba04b376e (diff)
Fix #31250, #31248: wrong vertex normals after transform apply, collada import,
sculpt shape key switch. All cases that called this function needed parameter only_face_normals set to false, so changed it now. Also fixed wrong user count for imported mesh from collada and simplified previous fix for tesselated faces to polygons conversion.
Diffstat (limited to 'source/blender/collada/MeshImporter.cpp')
-rw-r--r--source/blender/collada/MeshImporter.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/source/blender/collada/MeshImporter.cpp b/source/blender/collada/MeshImporter.cpp
index d6cc35deca7..3fbd33bdd0b 100644
--- a/source/blender/collada/MeshImporter.cpp
+++ b/source/blender/collada/MeshImporter.cpp
@@ -727,16 +727,6 @@ 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())
@@ -958,6 +948,7 @@ bool MeshImporter::write_geometry(const COLLADAFW::Geometry* geom)
const std::string& str_geom_id = mesh->getName().size() ? mesh->getName() : mesh->getOriginalId();
Mesh *me = add_mesh((char*)str_geom_id.c_str());
+ me->id.us--; // is already 1 here, but will be set later in set_mesh
// store the Mesh pointer to link it later with an Object
this->uid_mesh_map[mesh->getUniqueId()] = me;
@@ -972,6 +963,9 @@ bool MeshImporter::write_geometry(const COLLADAFW::Geometry* geom)
make_edges(me, 0);
+ BKE_mesh_convert_mfaces_to_mpolys(me);
+ BKE_mesh_tessface_clear(me);
+
mesh_calc_normals_mapping(me->mvert, me->totvert, me->mloop, me->mpoly, me->totloop, me->totpoly, NULL, NULL, 0, NULL, NULL);
return true;