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; }