Hi OpenSG users,
        in my application i have a fairly big library of models which i use
as prototypes
to build different pieces of a scene. Till the time being I just cloned the
prototype nodes and dragged then into the scene, but since the number of
traversed nodes is growing and growing, I am planning to make some model
optimization. 
The first step is to unshare all the geometry cores to apply the other
optimizations (i.e. flushing of transformations inside the geometries). 

I have written a small optimizer to unshared the geo cores which basically
looks like:

        osg::MFNodePtr parents = curNode->getCore()->getParents();

        printf ("Node %s has %d parents\n", osg::getName (curNode),
parents.size());

        if  (parents.size()>1)  // unshare this baby
        {
            osg::GeometryPtr core = osg::GeometryPtr::dcast
(curNode->getCore());
            osg::GeometryPtr newCore = core->clone ();
            
            beginEditCP( newCore );
                            OSG::separateProperties( newCore );
                    endEditCP( newCore );

            beginEditCP( curNode, osg::Node::CoreFieldMask );
                            curNode->setCore (newCore);
                    endEditCP( curNode, osg::Node::CoreFieldMask );

            printf ("splitted\n");
        }

As long as I just do the optimize and dump the model, all seems to work
fine: the geometries are unshared. 

My problem is that my app is working in a cluster environment, so when I do:

Node= prototypeNode->clone ();
Optimize (Node);

clientsceneRoot->addChild (Node);

in the server window doesn't appear any geometry. Probably I am messing up
with the change lists, but I can't see where is my problem...

thanks 
E.


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to