when loading the collada format models, parsing schema incorrect so that textures cannot be loaded correctly.
The reason is that in function of void CColladaFileLoader::readPolygonSection(io::IXMLReaderUTF8* reader,
core::array<SSource>& sources, scene::SMesh* mesh,
const core::stringc& geometryId) , it will find materials by calling const SColladaMaterial* CColladaFileLoader::findMaterial(const core::stringc& materialName), but there are no data in "core::array<scolladaimage> Images" yet. So, as a result, only the mesh displayed but not textures.![]</scolladaimage>
Thanks. Yeah, our Collada loader doesn't load library elements order independent as it should. I had the same trouble when exporting from SketchUp. It's on my todo already, but won't be make it into Irrlicht 1.9 (unless someone writes a patch in which case I certainly try to apply it).
Hi Micheal,
After debug, I fixed the issue, please update the file as a patch.The basic reason is that
Materials[mat].InstanceEffectIdis set to an empty string even if the texture is not found. The correct logic should bevideo::ITexture* texture = getTextureFromImage(Effects[effect].Textures[0], &(Effects[effect])); if(texture){ Materials[mat].Mat.setTexture(0, texture); // and indicate the material is instantiated by removing the effect ref Materials[mat].InstanceEffectId = ""; }When I understand the code correct that should only work if you have the case where it tries another findMaterial call after the first one failed. So in situations where texture and material sections are somehow mixed in the file and the same material is used later on again.
If that's the case then it's only fixing it accidentally sometimes like this. But maybe I don't understand it completely, it's a bit complex code and I didn't write it. Do you have a test-case for me?