added embed buffers as an option in serializer

This commit is contained in:
johan bowald
2018-03-30 11:49:36 +02:00
parent 7dcdc475a6
commit d2cd12ec27
2 changed files with 72 additions and 7 deletions

View File

@@ -17,6 +17,7 @@ int main(int argc, char *argv[])
std::string err;
std::string input_filename(argv[1]);
std::string output_filename(argv[2]);
std::string embedded_filename = output_filename.substr(0, output_filename.size() - 5) + "-Embedded.gltf";
// assume ascii glTF.
bool ret = loader.LoadASCIIFromFile(&model, &err, input_filename.c_str());
@@ -28,6 +29,9 @@ int main(int argc, char *argv[])
}
loader.WriteGltfSceneToFile(&model, output_filename);
// embed buffers
loader.WriteGltfSceneToFile(&model, embedded_filename, true);
return EXIT_SUCCESS;
}