Hi Neil, The ReaderWriter::Options structure has a data file path list built into it, this is checked before the main data file path list stored in the Registry is checked. So if you want a certainly directory checked just put it on your path, either via the ReaderWriter::Options or via the Registry using osgDB::s/getDataFilePathList. You'd typically use Options when you only want to locally set the search path.
Robert. On Thu, Apr 30, 2009 at 5:29 PM, <neil.hug...@tesco.net> wrote: > Hi All, > > I'd like to pick your collective brains for a moment in regards to search > paths for files within OSG. I'm currently working on the 3DS plugin for OSG, > looking at a little problem. The scenario is as follows. > > I have a 3DS file whose material table references a texture. When this model > was created the texture resided in the same directory as the model, and hence > no path information was stored - at least I guess that's why there is no path > information for the texture referenced. Now when I want to load this model, > the 3DS loader tries to locate the texture in the directory that the model > resides in - using the findfileindirectory function - but as the texture is > no longer in this directory, the function fails to find the file, and the 3DS > reader decides not to put a texture on the geometry. > > Now, the thing is, I do know where the texture is relative to the model. Its > in a parallel directory. In fact, if I ignore the result of the find file, > and merely just try and load the image, my readfilecallback handler amends > the path to the file, and the image loads. > > So, what I was wondering was whether there already exists a way by which I > can "direct" the findfileindirectory function to take account of a custom > search algorithm? I've had a look and I can't spot one, but wondered if > others might know differently? > > On the assumption that no such methodology exists, my thoughts were that I > could amend the existing function to call a custom defined function on the > user supplied readfilecallback - if one has been supplied - in the event > where the readfileindirectory function has failed. > > Any thoughts ? > > Thanks for any assistance/comments. > > Kind regards, > > Neil. > _______________________________________________ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org