Animation not displayed/rendered?

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
panto
Posts: 22
Joined: Thu Mar 17, 2011 5:44 pm

Animation not displayed/rendered?

Post by panto »

So.. I imported a .X file which has a walk animation from frames 1-25. Whenever I press KEY_KEY_W I want the model to play the animation. This is the code I have currently.

Code: Select all

		if( torsoNode )
		{
			f32 frameNumber = torsoNode->getFrameNr();
			if( frameNumber < 1 || frameNumber > 25)
				frameNumber = 1;
			
			torsoNode->setFrameLoop( 1, 25 );
			torsoNode->setAnimationSpeed( 5 );
			torsoNode->setLoopMode( true );

			torsoNode->setCurrentFrame( frameNumber );

			printf("\nCurrent Frame: %f\nAnimation speed: %f\n", (float)torsoNode->getFrameNr(),
				(float)torsoNode->getAnimationSpeed() );
		}
The printf shows correct data. Animation speed gradually builds up until it reaches 25, then instantly goes back to 1. Animation speed shows to be 5, as wanted. However, nothing actually happens in the application window.

I'm sorry if this has been asked before - I searched for a solution on the forums but found none.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Load your mesh into the mesh viewer. There you can see whether the animation works, how fast you need to set the speed, and also if at least the skeleton is animated (check the menu, there's a skeleton visible submenu). I guess that there's something improperly exported.
panto
Posts: 22
Joined: Thu Mar 17, 2011 5:44 pm

Post by panto »

Solved. I exported the .X mesh with wrong options, thanks to Bear_130278 for a helpful post which I found in the forum somewhere.

If anyone has this issue, just post here and I will tell you exactly what to do.
Post Reply