setLoopMode not working properly? (.X mesh)

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
Phant0m51
Posts: 106
Joined: Mon Jan 15, 2007 6:07 am

setLoopMode not working properly? (.X mesh)

Post by Phant0m51 »

Here's what's happening:

I have a scene loaded, and have a .X object looping an 'idle' animation. If I press a key, it sets the setLoopMode to false, so that I can use the IAnimationEndCallBack from another animation.

Everything up to this point is fine, my class gets called (Call back receiver). Inside my class I change setLoopMode back to true, but nothing happens. The idle animation never starts again, and if I press a key to get my other animation to start again, it doesn't do anything either.

I currently have a bool value that gets set to true when the key is pressed, and back to false when my Class gets it's call from IAnimationEndCallBack, which is being changed from true (key pressed) to false (end animation).

If I press the key again, it sets my value to True, but it never goes back to False because the animation won't run.

Setting and resetting setLoopMode causes no problems when animating the Faerie from the tutorials. I can change the loop as many times as I want, and it does what it's told.

I've tried to do the .X animations as .MS3D also, with the same problems.

Possible bug? Or did I code something wrong?

*EDIT* My code works with B3D files. .X and MS3D files just won't work for some reason.
Phant0m51
Posts: 106
Joined: Mon Jan 15, 2007 6:07 am

Post by Phant0m51 »

Nobody else is having similar problems with .X and MS3D files?
n00b
Posts: 58
Joined: Tue Sep 05, 2006 3:00 pm
Location: Earth
Contact:

Post by n00b »

i have a similar problem too.
I have a first person shooter weapon that animates when the mouse is clicked. it works the first time the mouse is clicked but then doesn't work for other clicks after that. anyone know how to fix this?
Phant0m51
Posts: 106
Joined: Mon Jan 15, 2007 6:07 am

Post by Phant0m51 »

What filetype are you using? Milkshape 3d can export to a ton of different files, you may want to see about downloading MS3D to convert your files to B3D.
xtheagonyscenex
Posts: 131
Joined: Fri Jun 03, 2005 7:26 pm

Post by xtheagonyscenex »

im not sure cuz i have these problems too but i think it may not start again because you have to set it true and tell irllicht which frame to loop
->setFrameLoop(0,0); every time you start or stop. also it might have to do with the main loop. :roll:
"Held in Your arms but too far from my heart." "These thoughts will carry me through the darkest nights...while your eyes rest in mine."
"How quickly I forget that this is meaningless."
n00b
Posts: 58
Joined: Tue Sep 05, 2006 3:00 pm
Location: Earth
Contact:

Post by n00b »

i'm using a .x file for my weapon.
at creation i set the loop mode to false, set animation speed to 0 and set the current frame to 0.
at LMB click, the animation speed is set to 25.
at the end animation callback, the animation speed is set to 0 and current frame is set to 0.
After all this, it still doesn't work. When i click the mouse button, the weapon animates once and then if i click again, nothing happens.
Does anyone knpw how to fix this?
KG
Posts: 35
Joined: Wed Jun 07, 2006 12:00 am

Post by KG »

Did you try anything like this?

Code: Select all

node->setFrameLoop(startframe, endframe);
node->setAnimationSpeed(fps);
node->setLoopMode(false);
This works flawlessly with my MS3D models, but I haven't tried it with any X models. It should repeat the animation once every time it is called.
Post Reply