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
This commit is contained in:
@@ -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<Options> local_opt = options ? static_cast<Options*>(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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user