Hi Morne,

You can modify the scene graph in the event traversal, just like you
can with the update traversal.  The only thing you need to be careful
about is that if you are modifying StateSet (and its contents) and
Drawables and their a rendering threads that are using these still
running - this only happens for the DrawThreadPerContext and
CullThreadPerCameraDrawThreadPerContext threading models.  The way to
avoid the main thread doing the updates and the rendering thread(s)
for overlapping is to make the StateSet and Drawable with a
DataVariance of DYNAMIC.

Robert.

On Wed, Jan 21, 2009 at 12:41 PM, Morné Pistorius
<[email protected]> wrote:
> Hi all,
>
> I used to work under the rule of thumb to only ever modify my scene
> using update callbacks, but scanning the lists I found reference
> saying that modification anywhere outside the viewer.RenderTraversal()
> is safe.  I just want to verify this: directly modifying my scene
> graph in an eventhandler should be safe, right? And this should still
> be safe if my scene is shared between multiple views (as in a
> composite viewer), but not if my scene is shared between more than one
> viewer window (assuming my viewers are created with a QGLWidget,
> instead of a QWidget in which case it will be safe again).  I call
> viewer.frame() on a QTimer evnet as in the OSG QtViewer examples.
>
> Have I got that right?
>
> Thanks!
>
> Morne
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to