diff --git a/apps/iv2gltf/main_iv2gltf.cxx b/apps/iv2gltf/main_iv2gltf.cxx index 61eebbb..402f7cf 100644 --- a/apps/iv2gltf/main_iv2gltf.cxx +++ b/apps/iv2gltf/main_iv2gltf.cxx @@ -36,7 +36,9 @@ int main(int argc, char* argv[]) if (SoSeparator* s = IvGltf::readFile(result["i"].as())) { IvGltfWriter w(s); w.setWriteBinary(result["b"].as()); - w.write(result["o"].as().c_str()); + if (!w.write(result["o"].as().c_str())) { + return EXIT_FAILURE; + } } else { return EXIT_FAILURE; diff --git a/shared/IvGltf/IvGltfWriter.cxx b/shared/IvGltf/IvGltfWriter.cxx index c1c624b..f1b3c3e 100644 --- a/shared/IvGltf/IvGltfWriter.cxx +++ b/shared/IvGltf/IvGltfWriter.cxx @@ -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; + }