Hi Bjorn,
I have just had a look at the example code you provided and it reproduces
the issue you see on my system which is the a good result as it means I'll
be able to confirm a fix once one is found.
I am not the author of osgAnimation so not best placed to debug it - I am
in not too dissimilar situation as yourself, looking at code to understand
the exact mechanism of what is intended and what might be going wrong.
>From the perspective as project lead I don't recall any submissions that
are likely candidates for causing this regression, Cedric Pinsion the
author of osgAnimation does have write permission to osgAnimation so may
have checked something in too. Looking at svn logs I haven't found
anything that could be a likely candidate.
As step in investigation I added some write methods into your code so we
can have a look at the resulting scene graphs before and after the clone
and the cloned one looks like it has entries duplicated. Perhaps a double
copy is going on somewhere. The code now looks like:
#include <osgViewer/Viewer>
#include <osgDB/ReadFile>
int main( int argc, char** argv ) {
osg::ArgumentParser arguments(&argc,argv);
// Load model containing animation
osg::ref_ptr<osgDB::ReaderWriter::Options> options = new
osgDB::ReaderWriter::Options;
options->setDatabasePath("C:/OpenSceneGraph-data");
osg::ref_ptr<osg::Node> nathanNode =
osgDB::readNodeFile("nathan.osg", options);
// Make a copy of node with skeleton
osg::ref_ptr<osg::Group> copiedNode =
osg::clone(nathanNode->asGroup(), osg::CopyOp::DEEP_COPY_ALL);
osgDB::writeNodeFile(*nathanNode,"original.osg");
osgDB::writeNodeFile(*copiedNode,"copied.osg");
osgViewer::Viewer viewer(arguments);
viewer.setSceneData(copiedNode);
viewer.run();
}
A diff between shows that geometry and state is duplicated that you
normally don't won't to clone, in production code I'd recommend sharing as
much as the scene graph as possible especially the leaves like geometry and
state. The bit that looks suspicious to me is that the UpdateBone contents
look to have part that are duplicated in the cloned version.
Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org