Hi Joel, You will have to write a custom NodeVisitor to collect details about your scene graph chosing what to deep copy and what to share, then process the data collected to copy and share where appropriate. I really can't provide further suggestions as this the guide the decision of what to and what not to copy is down to your application needs.
Robert. On 11 March 2012 03:28, Joel Graff <[email protected]> wrote: > So here's a bit of a mind-bender... > > I have a scene graph where I manage my "assets" (like loaded geometry) in a > separate, non-rendered section of the graph (I've taken to calling it the > "asset library"). > > Anyway, suppose in the rendered portion of my scene graph, I have several > nodes, one of which references a model that's loaded and exists under an LOD > node in the asset library. > > Now suppose I want to copy the node structure above this reference (in the > rendered portion of the graph), and I need it to be a deep copy. Obviously, > I don't want to deep copy my drawables (which is easily done), but since the > drawable "asset" really begins with the LOD parent, I wouldn't want the LOD > copied, either. > > The reasoning's pretty simple: suppose I add a detail level to the LOD > parent in the asset library at some point after I've made that deep copy. > The asset library LOD would update it's drawables with the new detail level, > but because the deep copy in the rendered portion of the graph would have > created a new LOD, the detail level wouldn't be reflected in the rendering. > > So I guess the question is: How can I "selectively" deep copy nodes? That > is, when I choose to deep copy a node which contains a reference to an LOD in > my (non-rendered) asset library, I want the node(s) above that reference to > be deep copied, but I want the LOD reference to remain unchanged - I don't > want a new LOD which references the geometry in the original LOD. > > My only solution would be to traverse the graph, "disconnect" all LOD > references, do the deep copy, then "reconnect" them in both the source and > the copied nodes, which could be difficult to manage... > > Any thoughts? > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=46147#46147 > > > > > > _______________________________________________ > 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

