diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2017-11-29 23:40:12 +0000 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2017-11-29 23:40:12 +0000 |
commit | 5c7f27562dc1ef449f23be5ab747a19c23eec361 (patch) | |
tree | 658416eb1f85eaa96dbc9a4a9762b0029e520476 /indra/llprimitive | |
parent | 84b6bce4ee9299454aca75d8f876b6582b756ff6 (diff) | |
parent | 1693ccba58eef676df1f91e50627545ac35bb819 (diff) |
merge
Diffstat (limited to 'indra/llprimitive')
-rw-r--r-- | indra/llprimitive/lldaeloader.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/indra/llprimitive/lldaeloader.cpp b/indra/llprimitive/lldaeloader.cpp index 768dc8284b..8401cb976e 100644 --- a/indra/llprimitive/lldaeloader.cpp +++ b/indra/llprimitive/lldaeloader.cpp @@ -862,16 +862,26 @@ bool LLDAELoader::OpenFile(const std::string& filename) setLoadState( READING_FILE ); //no suitable slm exists, load from the .dae file + + // Collada expects file and folder names to be escaped + // Note: cdom::nativePathToUri() + const char* allowed = + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "abcdefghijklmnopqrstuvwxyz" + "0123456789" + "%-._~:\"|\\/"; + std::string uri_filename = LLURI::escape(filename, allowed); + DAE dae; domCOLLADA* dom; if (mPreprocessDAE) { - dom = dae.openFromMemory(filename, preprocessDAE(filename).c_str()); + dom = dae.openFromMemory(uri_filename, preprocessDAE(filename).c_str()); } else { LL_INFOS() << "Skipping dae preprocessing" << LL_ENDL; - dom = dae.open(filename); + dom = dae.open(uri_filename); } if (!dom) @@ -900,7 +910,7 @@ bool LLDAELoader::OpenFile(const std::string& filename) daeInt count = db->getElementCount(NULL, COLLADA_TYPE_MESH); - daeDocument* doc = dae.getDoc(filename); + daeDocument* doc = dae.getDoc(uri_filename); if (!doc) { LL_WARNS() << "can't find internal doc" << LL_ENDL; |