소스 검색

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();