Hi Jan,
I tried both relative and absolute file paths.
The VRML file, which I try to load, is located
at /Developer/workspace/osgtest/model.wrl .
I reverted my changes of the VRML plugin and added the following line for
debugging purposes:
osg::notify(osg::INFO) << "fileName=" <<fileName.c_str() << std::endl;
After running this code,
osg::setNotifyLevel(osg::DEBUG_FP);
osg::ref_ptr<osg::Node> model = osgDB::readNodeFile("model.wrl");
osgViewer::Viewer viewer;
viewer.setSceneData(model.get());
I get the following debug output:
[...]
Opened DynamicLibrary osgPlugins-3.0.0/osgdb_vrml.so
itr='/Developer/workspace/osgtest/osgtest.app/Contents/Resources'
FindFileInPath() : trying
/Developer/workspace/osgtest/osgtest.app/Contents/Resources/model.wrl ...
itr='/Developer/workspace/osgtest'
FindFileInPath() : trying /Developer/workspace/osgtest/model.wrl ...
FindFileInPath() : USING /Developer/workspace/osgtest/model.wrl
fileName=file:///Developer/workspace/osgtest/model.wrl
[...]
OSG finds the correct file path and according to the last line of the debug
output, the VRML plugin prepends "file://".
But the plugin does not load anything and nothing is displayed on the
screen.
If I use an absolute path, this is the debug output:
[...]
FindFileInPath(/Developer/workspace/osgtest/model.wrl):
returning /Developer/workspace/osgtest/model.wrl
fileName=file:///Developer/workspace/osgtest/model.wrl
[...]
But still no model is visible.
If I disable the addition of "file://" in the VRML plugin, the model is
loaded and displayed, and the following debug output is generated:
[...]
FindFileInPath(/Developer/workspace/osgtest/model.wrl):
returning /Developer/workspace/osgtest/model.wrl
fileName=/Developer/workspace/osgtest/model.wrl
[...]
Both the absolute and relative file path works.
Thanks,
Michael
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org