-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmain.cpp
32 lines (28 loc) · 828 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "mesh_import.hpp"
int main(int argc, char** argv)
{
if (argc != 2)
{
std::cout << "Usage: mesh_importer <filename>" << std::endl;
return -1;
}
Assimp::Importer importer;
const aiScene* scene = importer.ReadFile(argv[1], aiProcess_CalcTangentSpace | aiProcess_Triangulate | aiProcess_JoinIdenticalVertices | aiProcess_SortByPType);
loader _loader;
bool success = _loader.load(scene, argv[1]);
if (!success)
{
std::cout << "Import failed! :(" << std::endl;
return -2;
}
// Dump meshes to file
/*
std::string output_pathname = _loader.get_output_path();
fmt::MemoryWriter output_mesh_filename;
output_mesh_filename << output_pathname << "/meshes.bin";
std::ofstream os(output_mesh_filename.c_str(), std::ios::binary);
cereal::BinaryOutputArchive archive(os);
archive(_loader);
*/
return 0;
}