Hi Robert,

Thanks for the quick reply!

That looks like exactly what I need.  One question, though--how do I "get"
the parent node?  I do not want my users to have to select it.

The code I am working on has do this:
osg::Node *node = editor->getSceneGraph()->loadFile(n);
but this does not seem to be applicable.

Thanks again,
Catherine

On 6/13/07, Robert Osfield <[EMAIL PROTECTED]> wrote:

Hi Catherine,

The osgDB::writeNodeFile(Node*, std::string) method can work on any
node in the scene graph so to write out a child:

  osgDB::write(parent->getChild(childNum), "mychildfile.osg");

On 6/13/07, Catherine Peloquin <[EMAIL PROTECTED]> wrote:
> Hello all,
>
> I have just started working with OpenSceneGraph, so I apologize if this
> question is simple.  I am working on an OSG/GTK project that imports
> stock.osg files into a viewer where they can be manipulated.  The
imported
> objects are arranged in a tree structure beneath a main node node.
>
> I need to save each of the imported and manipulated objects in the
> scenegraph into separate .osg files.
>
> My original idea was to get the main node, find out how many children
> (imported objects) it had, and iterate for each child to getChild() and
then
> somehow saving that child.  The problems I encountered were that I could
not
> figure out how to choose the main node without having the user select
it,
> and then found that getNumChildren() and getChild() were group, not node
> functions.  I also am not sure what the function is to save a child as a
> .osg file.
>
> Does anyone have any ideas as to how I could save the children
separately?
>
> Just to note, I am working on a Windows XP machine.
>
> Thank you,
> Catherine Peloquin
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
>
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to