diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2023-03-10 00:56:57 +0200 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2023-03-10 00:58:21 +0200 |
commit | 33e44b2059831594f91a84d07b316e8eee94bd4f (patch) | |
tree | c4aac988a78eabe02f474b35f40c5aa8106a5f6d /indra | |
parent | c90ffd84e0ebf788c2c67cc36c89757c6cbd2025 (diff) |
SL-19353 Mesh importer throws an error when the file extension is upper case
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llprimitive/llgltfloader.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llmodelpreview.cpp | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/indra/llprimitive/llgltfloader.cpp b/indra/llprimitive/llgltfloader.cpp index fd304f7bc9..7394f99794 100644 --- a/indra/llprimitive/llgltfloader.cpp +++ b/indra/llprimitive/llgltfloader.cpp @@ -106,10 +106,12 @@ bool LLGLTFLoader::OpenFile(const std::string &filename) tinygltf::TinyGLTF loader; std::string error_msg; std::string warn_msg; + std::string filename_lc(filename); + LLStringUtil::toLower(filename_lc); // Load a tinygltf model fom a file. Assumes that the input filename has already been // been sanitized to one of (.gltf , .glb) extensions, so does a simple find to distinguish. - if (std::string::npos == filename.rfind(".gltf")) + if (std::string::npos == filename_lc.rfind(".gltf")) { // file is binary mGltfLoaded = loader.LoadBinaryFromFile(&mGltfModel, &error_msg, &warn_msg, filename); } diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp index 56a48cb74d..7ae48eef8c 100644 --- a/indra/newview/llmodelpreview.cpp +++ b/indra/newview/llmodelpreview.cpp @@ -750,7 +750,9 @@ void LLModelPreview::loadModel(std::string filename, S32 lod, bool force_disable // three possible file extensions, .dae .gltf .glb // check for .dae and if not then assume one of the .gl?? - if (std::string::npos != filename.rfind(".dae")) + std::string filename_lc(filename); + LLStringUtil::toLower(filename_lc); + if (std::string::npos != filename_lc.rfind(".dae")) { mModelLoader = new LLDAELoader( filename, |