added small hack to better texture name managment in collada importing

This commit is contained in:
Paolo Cignoni 2015-03-24 17:44:11 +00:00
parent 571c59c180
commit 7b31a05a99
1 changed files with 855 additions and 851 deletions

View File

@ -207,8 +207,11 @@ namespace io {
else else
{ {
QDEBUG("Found use of Texture %s, adding it to texutres",qPrintable(textureFilename)); QDEBUG("Found use of Texture %s, adding it to texutres",qPrintable(textureFilename));
// Note that sometimes (in collada) the texture names could have been encoded with a url-like style (e.g. replacing spaces with '%20') so making some other attempt could be harmless
QString ConvertedName = textureFilename.replace(QString("%20"), QString(" "));
info.textureIdMap[textureFilename]=m.textures.size(); info.textureIdMap[textureFilename]=m.textures.size();
m.textures.push_back(qPrintable(textureFilename)); m.textures.push_back(qPrintable(ConvertedName));
ind_txt=info.textureIdMap[textureFilename]; ind_txt=info.textureIdMap[textureFilename];
} }
} }
@ -387,8 +390,9 @@ namespace io {
else else
{ {
QDEBUG("Found use of Texture %s, adding it to texutres",qPrintable(textureFilename)); QDEBUG("Found use of Texture %s, adding it to texutres",qPrintable(textureFilename));
QString ConvertedName = textureFilename.replace(QString("%20"), QString(" "));
info.textureIdMap[textureFilename]=m.textures.size(); info.textureIdMap[textureFilename]=m.textures.size();
m.textures.push_back(qPrintable(textureFilename)); m.textures.push_back(qPrintable(ConvertedName));
ind_txt=info.textureIdMap[textureFilename]; ind_txt=info.textureIdMap[textureFilename];
} }
// ind_txt = indexTextureByImgNode(*(info.doc),txt_node); // ind_txt = indexTextureByImgNode(*(info.doc),txt_node);