From 534052f7cb216ae4106e80ff44366e5d812a2943 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 11 Jan 2011 17:29:47 +0000 Subject: [PATCH] From Sukender, "FBX plugin did not relay the osgDB::ReaderWriter::Options* when writing images (the writeImage() call). Now it does." --- src/osgPlugins/fbx/WriterNodeVisitor.cpp | 7 ++++--- src/osgPlugins/fbx/WriterNodeVisitor.h | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/osgPlugins/fbx/WriterNodeVisitor.cpp b/src/osgPlugins/fbx/WriterNodeVisitor.cpp index d8254f725..2bd28e31d 100644 --- a/src/osgPlugins/fbx/WriterNodeVisitor.cpp +++ b/src/osgPlugins/fbx/WriterNodeVisitor.cpp @@ -335,6 +335,7 @@ WriterNodeVisitor::Material::Material(WriterNodeVisitor& writerNodeVisitor, ImageSet& imageSet, ImageFilenameSet& imageFilenameSet, unsigned int& lastGeneratedImageFileName, + const osgDB::ReaderWriter::Options * options, int index) : _index(index), _fbxMaterial(NULL), @@ -429,7 +430,7 @@ WriterNodeVisitor::Material::Material(WriterNodeVisitor& writerNodeVisitor, if (imageFilenameSet.find(destPath) != imageFilenameSet.end()) break; } lastGeneratedImageFileName = imageNumber; - osgDB::writeImageFile(*_osgImage, destPath); + osgDB::writeImageFile(*_osgImage, destPath, options); } else { @@ -441,7 +442,7 @@ WriterNodeVisitor::Material::Material(WriterNodeVisitor& writerNodeVisitor, { OSG_NOTICE << "Can't create directory for file '" << destPath << "'. May fail creating the image file." << std::endl; } - osgDB::writeImageFile(*_osgImage, destPath); + osgDB::writeImageFile(*_osgImage, destPath, options); } } @@ -474,7 +475,7 @@ int WriterNodeVisitor::processStateSet(const osg::StateSet* ss) { int matNum = _lastMaterialIndex; _materialMap.insert(MaterialMap::value_type(MaterialMap::key_type(ss), - Material(*this, _srcDirectory, ss, mat, tex, _pSdkManager, _directory, _imageSet, _imageFilenameSet, _lastGeneratedImageFileName, matNum))); + Material(*this, _srcDirectory, ss, mat, tex, _pSdkManager, _directory, _imageSet, _imageFilenameSet, _lastGeneratedImageFileName, _options, matNum))); ++_lastMaterialIndex; return matNum; } diff --git a/src/osgPlugins/fbx/WriterNodeVisitor.h b/src/osgPlugins/fbx/WriterNodeVisitor.h index 03632da9a..42d664095 100644 --- a/src/osgPlugins/fbx/WriterNodeVisitor.h +++ b/src/osgPlugins/fbx/WriterNodeVisitor.h @@ -149,6 +149,7 @@ class WriterNodeVisitor: public osg::NodeVisitor ImageSet& imageSet, ImageFilenameSet& imageFilenameSet, unsigned int& lastGeneratedImageFileName, + const osgDB::ReaderWriter::Options * options, int index = -1); KFbxTexture* getFbxTexture() const