Commit 02ebfb87 authored by Jan Möbius's avatar Jan Möbius
Browse files

Use addTexture from Core instead of directly accessing the textureNode

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@4615 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 814c9f47
......@@ -113,7 +113,15 @@ void TextureControlPlugin::slotTextureUpdated( QString _textureName , int _ident
OpenFlipper::Options::dirSeparator() +
textures_[textureid].filename;
PluginFunctions::triMeshObject(object)->textureNode()->read(filename.toUtf8());
// load to image
QImage textureImage;
if ( !textureImage.load( filename ) )
{
std::cerr << "Cannot load texture " << filename.toStdString() << "\n";
return ;
}
PluginFunctions::triMeshObject(object)->addTexture(_textureName,textureImage);
}
if ( object->dataType( DATA_POLY_MESH ) ) {
......@@ -126,7 +134,15 @@ void TextureControlPlugin::slotTextureUpdated( QString _textureName , int _ident
OpenFlipper::Options::dirSeparator() +
textures_[textureid].filename;
PluginFunctions::polyMeshObject(object)->textureNode()->read(filename.toUtf8());
// load to image
QImage textureImage;
if ( !textureImage.load( filename ) )
{
std::cerr << "Cannot load texture " << filename.toStdString() << "\n";
return ;
}
PluginFunctions::polyMeshObject(object)->addTexture(_textureName,textureImage);
}
emit updateView();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment