OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

How to add Animations stored in Fbx to another Fbx model


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> Plugins [osgPlugins]
View previous topic :: View next topic  
Author Message
Morkeleb
Newbie


Joined: 19 Mar 2013
Posts: 10

PostPosted: Mon Apr 08, 2013 11:01 am    Post subject:
How to add Animations stored in Fbx to another Fbx model
Reply with quote

Hi,

we bought severall Models in .fbx with Animations.
Most of the Animations lie in seperated .Fbx files.
How can i add the Animations out of an .fbx file(with no Model included) to another Model out of another .fbx file?

Thank you!

Cheers,
Michael
Back to top
View user's profile Send private message
Morkeleb
Newbie


Joined: 19 Mar 2013
Posts: 10

PostPosted: Mon Apr 22, 2013 7:37 pm    Post subject:
How to add Animations stored in Fbx to another Fbx model
Reply with quote

Hi,

we bought severall Models in .fbx with Animations.
Most of the Animations lie in seperated .Fbx files.
How can i add the Animations out of an .fbx file(with no Model included) to another Model out of another .fbx file?

Thank you!

Cheers,
Michael

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=53489#53489







------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
hybr
Appreciator


Joined: 26 Jun 2009
Posts: 454

PostPosted: Sun May 05, 2013 11:10 am    Post subject:
How to add Animations stored in Fbx to another Fbx model
Reply with quote

Hi

if models are same besides animation, you can just grab osgAnimation::Animation pointer from animation manager of one model and register it in animation manager from another model

22.04.2013, 23:42, "Michael Borst" <>:
Quote:
Hi,

we bought severall Models in .fbx with Animations.
Most of the Animations lie in seperated .Fbx files.
How can i add the Animations out of an .fbx file(with no Model included) to another Model out of another .fbx file?

Thank you!

Cheers,
Michael

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=53489#53489




------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Morkeleb
Newbie


Joined: 19 Mar 2013
Posts: 10

PostPosted: Mon May 27, 2013 7:26 am    Post subject:
Reply with quote

Hi,
if i do that, the programm shows me that it is playing the correct animation with every detail correct (Playtime, currently Playing, name etc) but i don't see anything, the model still has its arms spread like a bird and does nothing.

Am i missing something?


Thank you!

Cheers,
Michael
Back to top
View user's profile Send private message
hybr
Appreciator


Joined: 26 Jun 2009
Posts: 454

PostPosted: Mon May 27, 2013 9:42 am    Post subject:
How to add Animations stored in Fbx to another Fbx model
Reply with quote

Hi

idk, for me it worked out of the box :)

Cheers.

27.05.2013, 11:32, "Michael Borst" <>:
Quote:
Hi,
if i do that, the programm shows me that it is playing the correct animation with every detail correct (Playtime, currently Playing, name etc) but i don't see anything, the model still has its arms spread like a bird and does nothing.

Am i missing something?

Thank you!

Cheers,
Michael

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=54206#54206




------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Morkeleb
Newbie


Joined: 19 Mar 2013
Posts: 10

PostPosted: Tue May 28, 2013 4:22 am    Post subject:
Reply with quote

Do you have sample code,
maybe i am just missing one importent line or flag to be set

Thank you!

Cheers,
Michael
Back to top
View user's profile Send private message
hybr
Appreciator


Joined: 26 Jun 2009
Posts: 454

PostPosted: Tue May 28, 2013 10:08 am    Post subject:
How to add Animations stored in Fbx to another Fbx model
Reply with quote

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" <>:
Quote:
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




------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Morkeleb
Newbie


Joined: 19 Mar 2013
Posts: 10

PostPosted: Wed Jun 12, 2013 8:16 am    Post subject:
Reply with quote

Big Thanks,

it was the mergeModel->accept(famv); which i was missing.
Now this Problem is solved!


Thank you!

Cheers,
Michael
Back to top
View user's profile Send private message
Sebastian Messerschmidt
Guest





PostPosted: Tue Jun 18, 2013 7:02 am    Post subject:
How to add Animations stored in Fbx to another Fbx model
Reply with quote

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

Quote:
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" <>:
Quote:
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






------------------
Post generated by Mail2Forum
Back to top
hybr
Appreciator


Joined: 26 Jun 2009
Posts: 454

PostPosted: Tue Jun 18, 2013 10:24 am    Post subject:
How to add Animations stored in Fbx to another Fbx model
Reply with quote

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" <>:
Quote:
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

Quote:
 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" <>:
Quote:
 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

 
 




------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Sebastian Messerschmidt
Guest





PostPosted: Tue Jun 18, 2013 10:29 am    Post subject:
How to add Animations stored in Fbx to another Fbx model
Reply with quote

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
Quote:
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" <>:
Quote:
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

Quote:
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" <>:
Quote:
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








------------------
Post generated by Mail2Forum
Back to top
Sebastian Messerschmidt
Guest





PostPosted: Tue Jun 18, 2013 12:21 pm    Post subject:
How to add Animations stored in Fbx to another Fbx model
Reply with quote

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.

Quote:
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
Quote:
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"
<>:
Quote:
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

Quote:
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" <>:
Quote:
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












------------------
Post generated by Mail2Forum
Back to top
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> Plugins [osgPlugins] All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts Switch between primitive and model charlietan789 General 2 Mon Nov 12, 2018 2:25 am View latest post
No new posts Mapping texture coordinates to a port... ijwolf8 General 0 Thu Oct 25, 2018 8:11 pm View latest post
No new posts Model matrix kullboys General 0 Tue Aug 21, 2018 7:10 am View latest post
No new posts missing color for simple model with G... aroth General 1 Fri Jul 27, 2018 1:55 pm View latest post
No new posts Model(s) load ~10 times longer in 3.6... davisjamesf General 16 Wed Jul 04, 2018 7:18 pm View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP