From Colin McDonald, "The osgt/osgb file formats output a scenegraph node with the type

set to "SCENE" in the file header.  But if the file is stored and
then extracted again from an osga archive this header info is lost,
and the resulting file is just an "OBJECT".  Possibly other plugin
operations would have the same effect.  The osgt/osgb plugin won't
then return the scenegraph contents.

I have updated the osgt/osgb plugin to return a node from an "OBJECT"
file."
This commit is contained in:
Robert Osfield 2013-10-22 11:32:21 +00:00
parent c34a8e4ddb
commit 1196f153fc

View File

@ -242,7 +242,8 @@ public:
if ( !ii ) return ReadResult::FILE_NOT_HANDLED; if ( !ii ) return ReadResult::FILE_NOT_HANDLED;
InputStream is( options ); InputStream is( options );
if ( is.start(ii.get())!=InputStream::READ_SCENE ) osgDB::InputStream::ReadType readType = is.start(ii.get());
if ( readType!=InputStream::READ_SCENE && readType!=InputStream::READ_OBJECT )
{ {
CATCH_EXCEPTION(is); CATCH_EXCEPTION(is);
return ReadResult::FILE_NOT_HANDLED; return ReadResult::FILE_NOT_HANDLED;
@ -250,6 +251,7 @@ public:
is.decompress(); CATCH_EXCEPTION(is); is.decompress(); CATCH_EXCEPTION(is);
osg::Node* node = dynamic_cast<osg::Node*>(is.readObject()); CATCH_EXCEPTION(is); osg::Node* node = dynamic_cast<osg::Node*>(is.readObject()); CATCH_EXCEPTION(is);
if ( !node ) return ReadResult::FILE_NOT_HANDLED;
return node; return node;
} }