From 4e42c0f7e46a45b91b0be300d011ecd8f526884a Mon Sep 17 00:00:00 2001 From: Michael Wagner Date: Fri, 6 May 2022 11:38:52 +0200 Subject: [PATCH] added return code for gltf write --- apps/iv2gltf/main_iv2gltf.cxx | 4 +++- shared/IvGltf/IvGltfWriter.cxx | 5 ++--- 2 files changed, 5 insertions(+), 4 deletions(-) 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; + }