Skip to content
Snippets Groups Projects
Commit 2273db53 authored by Raphael Grimm's avatar Raphael Grimm
Browse files

Add verbosity flag to AssimpReader

parent a5624312
No related branches found
No related tags found
No related merge requests found
......@@ -77,7 +77,10 @@ namespace
error_log << " has no normals (and none were generated when loading it)\n";
return false;
}
error_log << " has no normals (and none were generated when loading it) (ignoring this)\n";
if (param.verbose)
{
error_log << " has no normals (and none were generated when loading it) (ignoring this)\n";
}
meta.regeneratedNormals = true;
}
......@@ -96,9 +99,10 @@ namespace
const auto& f = m.mFaces[i];
if (f.mNumIndices != 3)
{
error_log << " has face (# " << i
<< ") with the wrong number of vertices ("
<< f.mNumIndices << ")\n";
if (param.verbose || !param.skipInvalidFaces)
error_log << " has face (# " << i
<< ") with the wrong number of vertices ("
<< f.mNumIndices << ")\n";
if (param.skipInvalidFaces)
{
++meta.skippedFaces;
......
......@@ -30,7 +30,7 @@ namespace VirtualRobot
ManipulationObjectPtr readFileAsManipulationObject(const std::string& filename, const std::string& name = "");
ManipulationObjectPtr readBufferAsManipulationObject(const std::string_view& v, const std::string& name = "");
struct Parameters
{
float scaling = 1;
......@@ -39,6 +39,7 @@ namespace VirtualRobot
bool mergeMultipleMeshes = false;
bool ignoreMissingNormals = false;
bool skipInvalidFaces = false;
bool verbose = true;
};
Parameters parameters;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment