Thanks for the reply. I tried your suggestions:
// Cleaning scene
while (scene->getNChildren()>0)
{
OSG::beginEditCP( scene );
scene->subChild(0);
OSG::endEditCP( scene );
}
after it I add a node in the scene. My goal is to clean up the scene and
then add a single node alone... but when I use the code chunk you have
suggested, it crashes just at the rendering of the scene (
scenemanager->redraw() ). When I take the chunk off, it works perfectly,
only of course, with many nodes within the scene.... Any one has an ideia of
what is going on?
2007/10/10, Pablo Carneiro Elias <[EMAIL PROTECTED]>:
>
> thanks!
>
> 2007/10/10, Matthias Stiller <[EMAIL PROTECTED]>:
> >
> > Hello Pablo,
> >
> > you need to remove children from the back of the list or doing something
> > like this
> >
> > OSG::beginEditCP( scene );
> > while (scene->getNChildren()>0)
> > scene->subChild(0);
> > OSG::endEditCP( scene );
> >
> > HTH
> >
> > Matthias
> >
> > On Tuesday 09 October 2007 21:39, Pablo Carneiro Elias wrote:
> > > Hi eveyone.. I have a scene which is basically a Node with a
> > > Transform set as the core.... So, I add all geometry as child of this
> > > Node and now I just want to get children removed from that node....
> > > here's my chunk of code...
> > >
> > > unsigned int numChilds = scene->getNChildren();
> > >
> > > OSG::beginEditCP( scene );
> > >
> > > if( numChilds > 0 )
> > > {
> > > // Cleaning scene
> > > for( unsigned int i = 0 ; i < numChilds; i++ )
> > > {
> > > scene->subChild( i );
> > > }
> > >
> > > OSG::endEditCP( scene );
> > >
> > >
> > > It should work for me.... but it doesnt.... can anyone say whats the
> > > right way to clean up a node (remove children)...
> > >
> > >
> > > Thanks!!!!
> >
> > --
> > +---------------------+----------------------------+
> > | VREC GmbH | |
> > | Matthias Stiller | |
> > | Robert-Bosch-Str. 7 | tel: +49 6151 4921034 |
> > | 64293 Darmstadt | web: http://www.vrec.de |
> > | Germany | mail: [EMAIL PROTECTED] |
> > +---------------------+----------------------------+
> >
> >
> > -------------------------------------------------------------------------
> > This SF.net email is sponsored by: Splunk Inc.
> > Still grepping through log files to find problems? Stop.
> > Now Search log events and configuration files using AJAX and a browser.
> > Download your FREE copy of Splunk now >> http://get.splunk.com/
> > _______________________________________________
> > Opensg-users mailing list
> > Opensg-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/opensg-users
> >
>
>
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users