From d6e8fd34f0ddd254a3ed5d2faf202ec7fb975c1c Mon Sep 17 00:00:00 2001 From: John Senneker Date: Wed, 3 May 2017 15:11:31 -0400 Subject: [PATCH] Search for .gltf extension at end of file name for buffer prefix. Previously the code assumed that there would be only one '.' in the file name, which is not a valid assumption. This patch fixes this issue, but still assumes that the only occurrence of the string ".gltf" is at the end of the file name. In particular, it will fail on a file name like "/path/to/a.gltf/my_gltf.wrong_extension". --- code/glTFExporter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/glTFExporter.cpp b/code/glTFExporter.cpp index 203a46040..4dff289ac 100644 --- a/code/glTFExporter.cpp +++ b/code/glTFExporter.cpp @@ -511,7 +511,7 @@ void glTFExporter::ExportMeshes() // Variables needed for compression. END. std::string fname = std::string(mFilename); - std::string bufferIdPrefix = fname.substr(0, fname.find(".")); + std::string bufferIdPrefix = fname.substr(0, fname.rfind(".gltf")); std::string bufferId = mAsset->FindUniqueID("", bufferIdPrefix.c_str()); Ref b = mAsset->GetBodyBuffer();