Hi Daniele, On Wed, Jul 28, 2010 at 9:14 AM, daniele argiolas <[email protected]> wrote: > I've a program that has a thread running extern to osg viewer. I want to make > an addchild (and removechild) into my scene in my extern thread. I try but it > nothing appears. After I make the addchild I have to make some particular > instruction to show this?
It's really hard to know where to start when one has to guess so much about what you might actually be doing. All I can do is provide some general comments. First up you should only modify the scene graph single threaded, if you have an external thread that needs to modify the scene graph then it's best to create a command operation that you pass to the viewer to call when it does it's update traversal. The alternative is to put a mutex into the update traversal to block it when you are doing your mods, and also to block your thread when it's doing any of the other traversals. Another approach is to enable/disable nodes via a NodeMask, you haven't said when you are doing add/remove so I can't say at all whether this is appriate. Finally you don't have to doing anything to make an addChild/removeChild show in the scene graph. The application traverses the scene graph and if a child is there is traverses it. If it's not showing then it's because you either aren't rendering a new frame or you've messed up and aren't doing what you think you are doing. Robert. _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

