Page 1 of 1

md2 animations play all animations instead of choosen one

Posted: Tue Dec 26, 2006 8:53 pm
by dvh
Hi.

I use irrlicht 1.2 in linux and in the hello world demo, there is:

node->setMD2Animation ( scene::EMAT_STAND );

Which I think should do STANDing animation but it does all animations in md2 file (stand then walk then run ...) all. No matter which EMAT_* i choose, all animations are played one after another in a loop. I also try specify animation by string name "stand", "walk", ... but the result is the same.

node->setMD2Animation ( "stand" );

What's wrong :?

Posted: Tue Dec 26, 2006 9:16 pm
by bitplane
there's a bug in 1.2 where STAND animation starts at frame 0 which is deemed out of bounds, so the full animation is played instead. it is now fixed in svn.
just change line 316 in CAnimatedMeshSceneNode.cpp to

Code: Select all

	if (!(begin <= end && begin >= 0 && end <= frameCount))
and recompile irrlicht.

oh, and if you can't set "walk" as an animation, your mesh probably doesn't contain a "walk" animation

Posted: Wed Dec 27, 2006 9:06 pm
by omar shaaban
:shock: I THINK THE PROBLEM HERE is that u shouldn't write stand but write the animation frames u want to play
not like this
node->setMD2Animation ( scene::EMAT_STAND );
but like this
node->setFrameLoop(0, 310);
did u understand me!

thanks

Posted: Thu Dec 28, 2006 9:21 am
by dvh
Thanks it works, the problem was that bug in irrlicht. But also that setFrameLoop works, thanks.