|
|
|
@ -371,16 +371,17 @@ std::optional<MeshData3D> ObjImporter::doMesh3D(UnsignedInt id) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* Ignore unsupported keywords, error out on unknown keywords */ |
|
|
|
/* Ignore unsupported keywords, error out on unknown keywords */ |
|
|
|
} else if(![&keyword](){ |
|
|
|
} else { |
|
|
|
/* Using lambda to emulate for-else construct like in Python */ |
|
|
|
bool valid = false; |
|
|
|
const std::initializer_list<std::string> expected{"mtllib", "usemtl", "g", "s"}; |
|
|
|
const std::initializer_list<std::string> expected{"mtllib", "usemtl", "g", "s"}; |
|
|
|
for(auto it = expected.begin(); it != expected.end(); ++it) |
|
|
|
for(auto it = expected.begin(); it != expected.end(); ++it) |
|
|
|
if(keyword == *it) return true; |
|
|
|
if(keyword == *it) valid = true; |
|
|
|
return false; |
|
|
|
|
|
|
|
}()) { |
|
|
|
if(!valid) { |
|
|
|
Error() << "Trade::ObjImporter::mesh3D(): unknown keyword" << keyword; |
|
|
|
Error() << "Trade::ObjImporter::mesh3D(): unknown keyword" << keyword; |
|
|
|
return std::nullopt; |
|
|
|
return std::nullopt; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}} catch(std::exception) { |
|
|
|
}} catch(std::exception) { |
|
|
|
Error() << "Trade::ObjImporter::mesh3D(): error while converting numeric data"; |
|
|
|
Error() << "Trade::ObjImporter::mesh3D(): error while converting numeric data"; |
|
|
|
|