Skip to content

Commit

Permalink
added return code for gltf write
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Wagner committed May 6, 2022
1 parent 5d18961 commit 4e42c0f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 3 additions & 1 deletion apps/iv2gltf/main_iv2gltf.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ int main(int argc, char* argv[])
if (SoSeparator* s = IvGltf::readFile(result["i"].as<std::string>())) {
IvGltfWriter w(s);
w.setWriteBinary(result["b"].as<bool>());
w.write(result["o"].as<std::string>().c_str());
if (!w.write(result["o"].as<std::string>().c_str())) {
return EXIT_FAILURE;
}
}
else {
return EXIT_FAILURE;
Expand Down
5 changes: 2 additions & 3 deletions shared/IvGltf/IvGltfWriter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,14 @@ bool IvGltfWriter::write(std::string outputFilename)

// Save it to a file
tinygltf::TinyGLTF gltf;
gltf.WriteGltfSceneToFile(
return gltf.WriteGltfSceneToFile(
&m_model,
outputFilename,
true, // embedImages
true, // embedBuffers
true, // pretty print
m_writeBinary); // write binary

return false;

}


Expand Down

0 comments on commit 4e42c0f

Please sign in to comment.