Hi Paul, I'm afraid I can't work out the failure mechanism just be reading email. Could you provide a small code example program that could be compiled to show the problem you are seeing.
Robert. On Thu, Jan 29, 2009 at 12:09 PM, Paul Melis <[email protected]> wrote: > Hi Robert, > > I have a situation in which I want to set the userdata of a scenegraph node > to be another node, specifically one of its (indirect) parents. E.g. > > MyMatrixTransform (subclass of MatrixTransform) > child #1: Geode > drawable #1: some geometry, user data = MyMatrixTransform instance > child #2: Geode > ..... > > The reason for this is to simplify picking handling. The idea is that when > processing the list of intersected drawables during picking only those > drawables that have any userdata associated with them need to be processed. > The userdata pointer in that case immediately provides the parent transform > object (which holds application specific data), without having to go through > the list of parents until the transform is reached. > > However, this doesn't work because at runtime calls to > setThreadSafeRefUnref() are made by OSG and this results in infinite > recursion as Drawable::setThreadSafeRefUnref() calls > _userData->setThreadSafeRefUnref(), and that takes it back up the scene > graph, after which the transform's children are once again called with > setThreadSafeRefUnref(), etc. > > I'm having trouble locating the first call that starts it all. Is there a > way to avoid these calls? > > Regards, > Paul > > > > > _______________________________________________ > 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

