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:
parent
c34a8e4ddb
commit
1196f153fc
@ -242,7 +242,8 @@ public:
|
||||
if ( !ii ) return ReadResult::FILE_NOT_HANDLED;
|
||||
|
||||
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);
|
||||
return ReadResult::FILE_NOT_HANDLED;
|
||||
@ -250,6 +251,7 @@ public:
|
||||
|
||||
is.decompress(); CATCH_EXCEPTION(is);
|
||||
osg::Node* node = dynamic_cast<osg::Node*>(is.readObject()); CATCH_EXCEPTION(is);
|
||||
if ( !node ) return ReadResult::FILE_NOT_HANDLED;
|
||||
return node;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user