I came across the "non-support for shared PrimitiveSet" issue late last year. You can search the osg-users archives for the thread "Mismatch between Optimizer behavior and serializers" to see the discussion.
   -Paul

On 8/16/2012 9:32 AM, Miha Ravšelj wrote:
I found out that writePrimitiveSet and readPrimitiveSet does not have shared
object implementation(uniqueID) in InputStream and OutputStream. Is this by
design or was accidentally forgotten during development?

The following example produces invalid osg file:

osg::ref_ptr<osg::Geometry> geometry = new osg::Geometry;
osg::ref_ptr<osg::DrawArrays> drawArray = new osg::DrawArrays(GL_TRIANGLE_STRIP,
0,4);
geometry->addPrimitiveSet(drawArray);
geometry->addPrimitiveSet(drawArray);

osgDB::writeObjectFile(*geometry,"test.osgt");

Second primitiveset should be written only with uniqueID and not duplicated.
This causes invalid state when object is read back.

I have attached fixed InputStream.cpp and OutputStream.cpp which resolves issue
described above.

Miha


_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to