md2 animations play all animations instead of choosen one

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
dvh
Posts: 4
Joined: Mon Dec 25, 2006 3:25 pm

md2 animations play all animations instead of choosen one

Post 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 :?
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post 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
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
omar shaaban
Posts: 616
Joined: Wed Nov 01, 2006 6:26 pm
Location: Cairo,Egypt
Contact:

Post 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!
dvh
Posts: 4
Joined: Mon Dec 25, 2006 3:25 pm

thanks

Post by dvh »

Thanks it works, the problem was that bug in irrlicht. But also that setFrameLoop works, thanks.
Post Reply