浏览代码

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".
John Senneker 8 年之前
父节点
当前提交
d6e8fd34f0
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      code/glTFExporter.cpp

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