Commit 77695504 authored by Matthias Möller's avatar Matthias Möller
Browse files

update normals if they could not be extracted from the file

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@21144 383ad7c9-94d9-4d36-a494-682f7c89f535
parent c0b70d7a
......@@ -373,15 +373,15 @@ int FilePLYPlugin::loadTriMeshObject(QString _filename, OpenMesh::IO::Options& _
return -1;
}
//update normals if they aren't read
if (!_opt.vertex_has_normal() || !_opt.face_has_normal())
mesh->update_normals();
//cleanup mesh if selected option could not be loaded
if (!hadVNormals && !_opt.vertex_has_normal() && mesh->has_vertex_normals())
mesh->release_vertex_normals();
if (!hadVColors && !_opt.vertex_has_color() && mesh->has_vertex_colors())
mesh->release_vertex_colors();
if (!hadVTexCoords && !_opt.vertex_has_texcoord() && mesh->has_vertex_texcoords2D())
mesh->release_vertex_texcoords2D();
if (!hadFNormals && !_opt.face_has_normal() && mesh->has_face_normals())
mesh->release_face_normals();
if (!hadFColors && !_opt.face_has_color() && mesh->has_face_colors())
mesh->release_face_colors();
......@@ -444,15 +444,15 @@ int FilePLYPlugin::loadPolyMeshObject(QString _filename, OpenMesh::IO::Options&
return -1;
}
//update normals if they aren't read
if (!_opt.vertex_has_normal() || !_opt.face_has_normal())
mesh->update_normals();
//cleanup mesh if selected option could not be loaded
if (!hadVNormals && !_opt.vertex_has_normal() && mesh->has_vertex_normals())
mesh->release_vertex_normals();
if (!hadVColors && !_opt.vertex_has_color() && mesh->has_vertex_colors())
mesh->release_vertex_colors();
if (!hadVTexCoords && !_opt.vertex_has_texcoord() && mesh->has_vertex_texcoords2D())
mesh->release_vertex_texcoords2D();
if (!hadFNormals && !_opt.face_has_normal() && mesh->has_face_normals())
mesh->release_face_normals();
if (!hadFColors && !_opt.face_has_color() && mesh->has_face_colors())
mesh->release_face_colors();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment