Problem with useAnimationFrom

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
dev4fun
Posts: 3
Joined: Fri Jun 09, 2017 3:03 pm

Problem with useAnimationFrom

Post by dev4fun »

Hey, I separate my character in 2 files, one where have just bones and animation and other for skinned mesh. Im trying make mesh use animation from b3d file where have animation, but something is wrong.
It's animating normally, but the position of meshes it's wrong, check the picture:

Image

How should be:

Image

Code that i used:

Code: Select all

IAnimatedMesh* mesh = smgr->getMesh( "obj.b3d" );
    IAnimatedMesh* anim = smgr->getMesh( "anim.b3d" );
 
    ISkinnedMesh* skinmesh = (ISkinnedMesh*)mesh;
    ISkinnedMesh* skinanim = (ISkinnedMesh*)anim;
 
    skinmesh->useAnimationFrom( skinanim );
 
    IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh );
    node->setLoopMode( TRUE );
    node->setFrameLoop( 0, 100 );
    node->setAnimationSpeed( 30 );
    node->animateJoints();
Thanks.

* if i use one just file, with mesh and animation on same file, run perfectly
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Problem with useAnimationFrom

Post by CuteAlien »

You shouldn't have to do the animateJoints() usually (don't know what it will do really -but should be done somewhere in drawAll() so maybe it causes it to be called twice now?). If that's not it - then don't know without debugging.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
dev4fun
Posts: 3
Joined: Fri Jun 09, 2017 3:03 pm

Re: Problem with useAnimationFrom

Post by dev4fun »

CuteAlien wrote:You shouldn't have to do the animateJoints() usually (don't know what it will do really -but should be done somewhere in drawAll() so maybe it causes it to be called twice now?). If that's not it - then don't know without debugging.
Hmm, I remove this code, but the problem keep on.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Problem with useAnimationFrom

Post by CuteAlien »

If you can send me (or link to) some test-models I'll try to find some time to debug. Can't help too much otherwise, it's been a few years since I last used that part of Irrlicht myself.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply