I've tried a different approach and still I'm failing.
An alternative set I use, is a mesh with a skeleton, not containing any animations thus no BasicAnimationManager for the first model. The second model is the same skeleton (without the geometries) and an animation.

Can anyone help me with this? I have no clue how to tell the animation which skeleton to use, as there are two: first with geometry and second without.

Hi Sergey,

The models are from a commercial package and are actually using the same skeleton etc. Only difference is that the first one is containing the mesh associated with the skeleton and only an idle animation. The other model contains only the skeleton along with an animation.
Basically the idea is to separate the animations from the mesh.

cheers
Sebastian
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

_______________________________________________
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

Reply via email to