From 166a8b6ccfedffde2ced3e78123377c8c4493fde Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 20 Nov 2014 16:38:17 +0000 Subject: [PATCH] From Farshid Lashkari, "The obj loader was overriding the existing database path list with the file path of the model, instead of prepending the file path to the path list. The latter seems to be more common behavior for most of the existing loader plugins. Also, the local options weren't actually being used when processing the scene graph for textures. I've attached the fix for both issues." git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14506 16af8721-9629-0410-8352-f15c8da7e697 --- src/osgPlugins/obj/ReaderWriterOBJ.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/osgPlugins/obj/ReaderWriterOBJ.cpp b/src/osgPlugins/obj/ReaderWriterOBJ.cpp index 64b8df884..e6f089021 100644 --- a/src/osgPlugins/obj/ReaderWriterOBJ.cpp +++ b/src/osgPlugins/obj/ReaderWriterOBJ.cpp @@ -867,7 +867,7 @@ osgDB::ReaderWriter::ReadResult ReaderWriterOBJ::readNode(const std::string& fil // code for setting up the database path so that internally referenced file are searched for on relative paths. osg::ref_ptr local_opt = options ? static_cast(options->clone(osg::CopyOp::SHALLOW_COPY)) : new Options; - local_opt->setDatabasePath(osgDB::getFilePath(fileName)); + local_opt->getDatabasePathList().push_front(osgDB::getFilePath(fileName)); obj::Model model; model.setDatabasePath(osgDB::getFilePath(fileName.c_str())); @@ -875,7 +875,7 @@ osgDB::ReaderWriter::ReadResult ReaderWriterOBJ::readNode(const std::string& fil ObjOptionsStruct localOptions = parseOptions(options); - osg::Node* node = convertModelToSceneGraph(model, localOptions, options); + osg::Node* node = convertModelToSceneGraph(model, localOptions, local_opt.get()); return node; }