Operating System: :Windows 10:
Render System: :D3D9, OpenGL:
In our app we colourise our models by creating textures as PNG files and load them using the code below. This was working in 1.10 but in 1.11 we get FileNotFoundException from the mat->applyTextureAliases(texNameList) call.
Code: Select all
// Use the original material as a template, clone it and update the texture image
// http://www.ogre3d.org/forums/viewtopic.php?f=21&t=64635
Ogre::MaterialManager &mm = Ogre::MaterialManager::getSingleton();
// Get an existing material
Ogre::MaterialPtr mat = mm.getByName(materialName);
if(!mat)
{
Ogre::MaterialPtr templateMat = mm.getByName(templateMaterialName);
assert(templateMat);
mat = templateMat->clone(materialName);
m_materialNames.push_back(materialName);
bool ok = mat->applyTextureAliases(texNameList); // FileNotFoundException here in 1.11
assert(ok);
Ogre::TextureManager &tm = Ogre::TextureManager::getSingleton();
Ogre::AliasTextureNamePairList::iterator iend = texNameList.end();
for(Ogre::AliasTextureNamePairList::iterator i = texNameList.begin(); i != iend; ++i)
{
tm.unload(i->second);
}
mat->load();
}
return mat;
Code: Select all
ResourceGroupManager::getSingleton().addResourceLocation(mediaPath, "FileSystem", "General");
What do I need to do to make this work again?