Enrico wrote:
> Hi openSG users,
>
> I have the very same scene represented two times, 
> one locally and one remotely. 
> Actually I build the full scene in the server window and then
> clone it locally.
>
> Localviewport->setRoot(serverRoot->clone())
>
> The problem is that when I subChild anything from the original root,
> I expect the same changes reflecting locally. 
>   
Since clone creates a separate tree, that won't happen.

Note that a viewport doesn't need a clone to work, you can add parts of 
a tree to different viewports. (The SimpleSceneManager is a different 
beast, though). I don't know if that will work in your case though, but 
it's worth keeping in mind.
> Is there a way to inform the clone node that it has to subChild 
> part of it's subTree?
>
>   
I have a function that looks like this, it replaces a core instance 
everywhere. You could perhaps use the same thing to do subChild:

void MyNodeWrapper::replaceCoreEverywhere(osg::NodeCorePtr& core)
{
    assert(core);

    osg::NodeCorePtr oldCore = m_node->getCore();
    const osg::MFNodePtr& parents = oldCore->getParents();

    for (size_t i = 0; i < parents.size(); ++i) {
        osg::NodePtr node = parents[i];
        CPEdit(node, osg::Node::CoreFieldMask);
        node->setCore(core);
    }
}


Cheers,
/Marcus

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to