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".
pull/1256/head
John Senneker 2017-05-03 15:11:31 -04:00
parent b1e89e3636
commit d6e8fd34f0
1 changed files with 1 additions and 1 deletions

View File

@ -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<Buffer> b = mAsset->GetBodyBuffer();