Fixes the more basic probelm of "SGModelLib::findDataFile" resolving an
empty file name to the fgdata (directory) path. findData_File_ should
never return a _directory_ path, only valid _file_ names.
if (pImage)
{
imageName = pImage->getStringValue();
- if (!imageName.empty())
+ absFileName = SGModelLib::findDataFile(imageName, options);
+ if (absFileName.empty())
{
- absFileName = SGModelLib::findDataFile(imageName, options);
- if (absFileName.empty())
- {
- SG_LOG(SG_INPUT, SG_ALERT, "Texture file not found: '"
- << imageName << "'");
- }
+ SG_LOG(SG_INPUT, SG_ALERT, "Texture file not found: '"
+ << imageName << "'");
}
}
const osgDB::ReaderWriter::Options* opts,
SGPath currentPath)
{
+ if (file.empty())
+ return file;
SGPath p = ResourceManager::instance()->findPath(file, currentPath);
- if (p.exists()) {
+ if (p.exists()&&p.isFile()) {
return p.str();
}
-
+
// finally hand on to standard OSG behaviour
return osgDB::findDataFile(file, opts);
}