I was pondering this the other day and it occurred to me that the problem 
boiled down to the fact that some (if not all) serializers do not write via a 
subclass of NodeVisitor, and hence are unaffected by nodemasks.
I wondered if you could simply make your node so it is ONLY visible to 
NodeVisitor traversal by subclassing the node and overriding the traverse 
function. e.g.


Code:
class NonSerializedGroup : public osg::Group
{
public:
    UnserializedGroup(osg::Group* unserializedGroup)
        : _unserializedGroup(unserializedGroup) { }
    void traverse(osg::NodeVisitor& nv)
    {
        _unserializedGroup->traverse(nv);    
    }
    osg::ref_ptr<osg::Group> _unserializedGroup;
}



graffy wrote:
> Hi,
> 
> I have a graph that I serialize with a simple call to osgDB::writeNodeFile(), 
> but it contains a node that is auto-generated when the application starts.  
> Is there a way to exclude that node from serialization?  I'm familiar with 
> the setNodeMask() / setTraversalMask() mechanism used in visitor classes, but 
> wasn't finding something similiar for serialization - nothing jumped out at 
> me in the ReaderWriter docs, anyway.
> 
> ... 
> 
> Thank you!
> 
> Cheers,
> Joel


------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=42491#42491





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

Reply via email to