Allow "texture-path" XML entries to be present but empty.
This had worked with previous FG versions and is used by many models - so it shouldn't be treated as an error now.
This commit is contained in:
@@ -247,10 +247,13 @@ sgLoad3DModel_internal(const SGPath& path,
|
|||||||
|
|
||||||
if (props->hasValue("/texture-path")) {
|
if (props->hasValue("/texture-path")) {
|
||||||
string texturePathStr = props->getStringValue("/texture-path");
|
string texturePathStr = props->getStringValue("/texture-path");
|
||||||
texturepath = SGModelLib::findDataFile(texturePathStr, NULL, modelDir);
|
if (!texturePathStr.empty())
|
||||||
if (texturepath.isNull())
|
{
|
||||||
throw sg_io_exception("Texture file not found: '" + texturePathStr + "'",
|
texturepath = SGModelLib::findDataFile(texturePathStr, NULL, modelDir);
|
||||||
path.str());
|
if (texturepath.isNull())
|
||||||
|
throw sg_io_exception("Texture file not found: '" + texturePathStr + "'",
|
||||||
|
path.str());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
model = new osg::Node;
|
model = new osg::Node;
|
||||||
|
|||||||
Reference in New Issue
Block a user