Problem loading animated .x file

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
timofiend
Posts: 14
Joined: Tue Feb 22, 2011 5:57 pm
Location: 115

Problem loading animated .x file

Post by timofiend »

I can load the example dwarf animation, and a simple character rigged with biped in 3dsmax and animated to walk a few steps. I then tried to animate a more complex character, just to walk a few steps aswell, and when trying to load it using the standard code I used for the other models, I get this error.

First-chance exception at 0x100dfbe8 in 3rdPersonCam.exe: 0xC0000005: Access violation reading location 0xababaca3.
Unhandled exception at 0x100dfbe8 in 3rdPersonCam.exe: 0xC0000005: Access violation reading location 0xababaca3.

The code I am using to load the .x animation is this:

Code: Select all

		scene::IAnimatedMesh* mesh = smgr->getMesh("C:/Users/Tims/Desktop/New folder/timwalk2.x"); 
		scene::IAnimatedMeshSceneNode* node1 = smgr->addAnimatedMeshSceneNode(mesh); 
		if (node1) 
		{ 
			  node1->setMaterialFlag(video::EMF_LIGHTING, false); 
			  node1->setPosition(core::vector3df(0,30,0)); 
			  node1->setRotation(core::vector3df(0,0,0)); 
			  node1->setScale(core::vector3df(0.75,0.75,0.75)); 
			  node1->setAnimationSpeed(2000.f);
			 
		}
I cant see anything wrong with this bit of code, could there be a problem elsewhere that would cause this error? I thought it was something to do with the model not the code, as I can load the example files fine and even a simple character mesh rigged with biped. Im sure the same technique was used to animated the more complex model, so I dont understand why I would be getting this error. (Also tried taking the original not animated version of the complex model, and animating it again to see if something had gone wrong with the animating process, but same error.)

EDIT: Also tried using multires modifier to lower to polycount on the model to see if that was an issue, but it makes no difference to the error.

Any suggestions on what could be going wrong would be appreciated. Can post my full code up if needs be.

Cheers.
Last edited by timofiend on Sun Mar 20, 2011 8:15 pm, edited 1 time in total.
ChaiRuiPeng
Posts: 363
Joined: Thu Dec 16, 2010 8:50 pm
Location: Somewhere in the clouds.. drinking pink lemonade and sunshine..

Post by ChaiRuiPeng »

how big is the rest of your code?

...if it's not too big please post it...
ent1ty wrote: success is a matter of concentration and desire
Butler Lampson wrote: all problems in Computer Science can be solved by another level of indirection
at a cost measure in computer resources ;)
timofiend
Posts: 14
Joined: Tue Feb 22, 2011 5:57 pm
Location: 115

Post by timofiend »

Well its quite big, not rediculously so though. My friend posted it in a different topic asking a different question, so you can see it here:

http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=43388

Yes I realise its abit of a mess, we are still learning and have a meeting planned with one of our teachers to show us a little of how we should organise our code. I figure it shouldnt just all have been put in the main function, so could the way we have organised our code also be part of the problem?

In the code he has posted, he has replaced the file we were trying to load (that wasnt working) with the dwarf example file, as he wasnt working on the animation at the time so it didnt matter what the character looked like.
Post Reply