Hi You can do this trick only with animations applied to identical models: vertices, bones and transforms names\hierarchy etc. should be same in both models, just animation is different.
You can't hotswap animation from different model. Cheers. 18.06.2013, 11:08, "Sebastian Messerschmidt" <[email protected]>: > Hi, > > I'm trying to do the same thing. I've got two models (fbx). The first > one is containing an animation and a skeleton with (rigged) geometry. > The second file contains an animation and another skeleton. > > Unfortunately, the merging approach doesn't seem to work. I can animate > the second one, but I cannot apply the animation to the first skeleton. > Any idea, how to apply the second animation to the first skeleton? > > I've already tried to replace the second skeleton with the first one, > but no luck. > > Or maybe someone can provide an example model with animation(s) in a > second file. > > cheers > Sebastian > >> void mergeAnimation(osg::Node* mainModel, osg::Node* mergeModel) >> { >> FindAnimationManagerVisitor famvMain; >> mainModel->accept(famvMain); >> osgAnimation::AnimationManagerBase* animationManagerMain = >> famvMain.getAnimationManager(); >> if (animationManagerMain == 0) >> throw std::logic_error("no animation manager found in main >> model"); >> >> FindAnimationManagerVisitor famv; >> mergeModel->accept(famv); >> osgAnimation::AnimationManagerBase* animationManager = >> famv.getAnimationManager(); >> if (animationManager == 0) >> throw std::logic_error("no animation manager found in >> secondary model"); >> >> const osgAnimation::AnimationList& list = >> animationManager->getAnimationList(); >> for (osgAnimation::AnimationList::const_iterator ai = list.begin(); >> ai != list.end(); ai++) >> animationManagerMain->registerAnimation(*ai); >> } >> >> 28.05.2013, 08:27, "Michael Borst" <[email protected]>: >>> Do you have sample code, >>> maybe i am just missing one importent line or flag to be set >>> >>> Thank you! >>> >>> Cheers, >>> Michael >>> >>> ------------------ >>> Read this topic online here: >>> http://forum.openscenegraph.org/viewtopic.php?p=54235#54235 >>> >>> _______________________________________________ >>> 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 > > _______________________________________________ > 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

