Restructed the setting of the default osgDB::Options so it doesn't override the ObjectCacheHint setting when a user specified osgDB::Options object is passed in.

This commit is contained in:
Robert Osfield 2019-07-01 12:56:36 +01:00
parent 8d505e80a9
commit fe9c235806

View File

@ -305,10 +305,14 @@ ReaderWriterFBX::readNode(const std::string& filenameInit,
int nLightCount = 0;
osg::ref_ptr<Options> localOptions = NULL;
if (options)
{
localOptions = options->cloneOptions();
}
else
{
localOptions = new osgDB::Options();
localOptions->setObjectCacheHint(osgDB::ReaderWriter::Options::CACHE_IMAGES);
localOptions->setObjectCacheHint(osgDB::ReaderWriter::Options::CACHE_IMAGES);
}
std::string filePath = osgDB::getFilePath(filename);
FbxMaterialToOsgStateSet fbxMaterialToOsgStateSet(filePath, localOptions.get(), lightmapTextures);