summaryrefslogtreecommitdiff
path: root/indra/llprimitive/lldaeloader.cpp
diff options
context:
space:
mode:
authorcallum_linden <callum@lindenlab.com>2017-11-30 14:44:44 -0800
committercallum_linden <callum@lindenlab.com>2017-11-30 14:44:44 -0800
commitdd0d2805e2b495246525f49325c4492b7b57f157 (patch)
tree96ae78468bbe760c4934416764a4cd89cf5ae381 /indra/llprimitive/lldaeloader.cpp
parent2e3c5ac88a434ee437bc3e68b321d5bd0bcd7cc9 (diff)
parente3a2c5e3217ae74a0277f2e6d4e1e708fe398a1c (diff)
Automated erge with tip of viewer64
Diffstat (limited to 'indra/llprimitive/lldaeloader.cpp')
-rw-r--r--indra/llprimitive/lldaeloader.cpp16
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;