diff options
| author | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2025-09-11 22:32:03 +0300 |
|---|---|---|
| committer | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2025-09-12 09:40:20 +0300 |
| commit | ac2cbdcc02efb8af88d91f02ec1b58022e4bf439 (patch) | |
| tree | a4b369f18ca8f5c23b2daee4916a3883150b1546 | |
| parent | c3c45e00abd8b10679d911e1b92d2acb91aaf209 (diff) | |
#4660 Unable to upload GLTF+bin with spaces in the name
| -rw-r--r-- | indra/newview/gltf/accessor.cpp | 5 | ||||
| -rw-r--r-- | indra/newview/gltf/llgltfloader.cpp | 8 |
2 files changed, 13 insertions, 0 deletions
diff --git a/indra/newview/gltf/accessor.cpp b/indra/newview/gltf/accessor.cpp index 03f7331893..f0ad3fa594 100644 --- a/indra/newview/gltf/accessor.cpp +++ b/indra/newview/gltf/accessor.cpp @@ -158,6 +158,11 @@ bool Buffer::prep(Asset& asset) { std::string dir = gDirUtilp->getDirName(asset.mFilename); std::string bin_file = dir + gDirUtilp->getDirDelimiter() + mUri; + if (!gDirUtilp->fileExists(bin_file)) + { + // Characters might be escaped in the URI + bin_file = dir + gDirUtilp->getDirDelimiter() + LLURI::unescape(mUri); + } llifstream file(bin_file.c_str(), std::ios::binary); if (!file.is_open()) diff --git a/indra/newview/gltf/llgltfloader.cpp b/indra/newview/gltf/llgltfloader.cpp index dd1d327683..af00b8a022 100644 --- a/indra/newview/gltf/llgltfloader.cpp +++ b/indra/newview/gltf/llgltfloader.cpp @@ -652,6 +652,14 @@ std::string LLGLTFLoader::processTexture(S32 texture_index, const std::string& t filename = filename.substr(pos + 1); } + std::string dir = gDirUtilp->getDirName(mFilename); + std::string full_path = dir + gDirUtilp->getDirDelimiter() + filename; + if (!gDirUtilp->fileExists(full_path) && filename.find("data:") == std::string::npos) + { + // Uri might be escaped + filename = LLURI::unescape(filename); + } + LL_INFOS("GLTF_IMPORT") << "Found texture: " << filename << " for material: " << material_name << LL_ENDL; LLSD args; |
