Try using the .osgt extension rather than .osg.
_______________________________________________
osg-users mailing list
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Looking at the plugin implementation it'll be the fact that the same
ReaderWriter is used for all of the .osgt, .osgb and .osgx formats, if
you use a readObject()/writeObject() with a filename the plugin will
automatically set the type of file, but if you use a
std::istream/ostream then it'll look to the Option string to see what
type to read. To select .osgt ascii add an "Ascii" entry into the
osgDB::Option::OptionString.
The code in src/osgPlugin/osg/ReaderWriterOSG2.cpp that does the
automatically assignment from the extension to the OptionsString is in
prepareReading and prepareWriting method and looks like:
if ( ext=="osgt" ) local_opt->setOptionString(
local_opt->getOptionString() + " Ascii" );
else if ( ext=="osgx" ) local_opt->setOptionString(
local_opt->getOptionString() + " XML" );
So adding this in yourself will be the thing to do.
Robert.