I see. That's an alternative. The only thing is if I have more than one I
have to serialize my collection class as well. The way I did it so far, by
making my data items as osg::Nodes, I could add all of them to the root
group and I didn't need to serialize the collection. But I'll think about
the alternative.

Thanks, much helpful!
Eduardo

On Tue, Mar 29, 2011 at 6:31 AM, Thrall, Bryan <
bryan.thr...@flightsafety.com> wrote:

> Eduardo Poyart wrote on 2011-03-28:
> > But I can't add an osg::Object to an osg::Group... I want my data to be
> > saved with the scene, so I made it derive from osg::Node and added it
> > to my root group. Unless there is another way?
>
> You can add it as user data (see osg::Object::setUserData()) if it is an
> osg::Object. It looks like user data is serialized.
>
> > On Mon, Mar 28, 2011 at 11:00 AM, Robert Osfield
> > <robert.osfi...@gmail.com> wrote:
> >
> >       On Mon, Mar 28, 2011 at 6:52 PM, Eduardo Poyart <poy...@gmail.com>
> > wrote:        > I did it with the serializers. The document on the Wiki
> helped
> > a lot. I      > would be lost without it.     > The only funny thing is
> that I
> > had to make my class derive from Node and add         > it to the scene
> graph,
> > even though it's not graphics related at all!
> >
> >
> >       I don't know the specifics of your case, but serializers work for
> any
> >       object subclassed from osg::Object      so there isn't any need to
> subclass
> > from osg::Node.  So if you had        some custom user data you could
> >       subclass from osg::Object and then provide the serializers for this
> >       subclass and in theory the serilizers   should then output your
> object.
> --
> Bryan Thrall
> FlightSafety International
> bryan.thr...@flightsafety.com
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to