Commit 13f98195 authored by Jan Möbius's avatar Jan Möbius

Log Information if normals are computed automatically.

parent 9592c6d2
......@@ -367,8 +367,22 @@ int FilePLYPlugin::loadTriMeshObject(QString _filename, OpenMesh::IO::Options& _
}
//update normals if they aren't read
if (!_opt.vertex_has_normal() || !_opt.face_has_normal())
mesh->update_normals();
if (!_opt.vertex_has_normal() || !_opt.face_has_normal()) {
if (_opt.vertex_has_normal() ) {
// If we have vertex normals, we can use them to compute the face normals
emit log(LOGINFO,"Vertex normals loaded from file. Computing Face normals.");
mesh->update_face_normals();
std::cerr << "Update face normals" << std::endl;
} else {
// If we don't have any normals, we compute all of them
emit log(LOGINFO,"File did not contain normals. Computing automatically.");
mesh->update_normals();
}
}
//cleanup mesh if selected option could not be loaded
if (!hadVColors && !_opt.vertex_has_color() && mesh->has_vertex_colors())
......@@ -437,9 +451,24 @@ 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();
if (!_opt.vertex_has_normal() || !_opt.face_has_normal()) {
if (_opt.vertex_has_normal() ) {
// If we have vertex normals, we can use them to compute the face normals
emit log(LOGINFO,"Vertex normals loaded from file. Computing Face normals.");
mesh->update_face_normals();
std::cerr << "Update face normals" << std::endl;
} else {
// If we don't have any normals, we compute all of them
emit log(LOGINFO,"File did not contain normals. Computing automatically.");
mesh->update_normals();
}
}
//cleanup mesh if selected option could not be loaded
if (!hadVColors && !_opt.vertex_has_color() && mesh->has_vertex_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