Problem loading .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
DarksideX
Posts: 22
Joined: Wed Dec 10, 2008 7:42 am

Problem loading .x file

Post by DarksideX »

Hello.

My problem is that the animation wont load when i put it into my game. The console says: "Not matching normal and face index count found in x file" when i load the mesh.

I made the mesh and added the animation with blender and then exported it into an .x file.


This is the code used for loading the mesh.

Code: Select all

IAnimatedMesh* draPlayerSet = smgr->getMesh("Data/Models/gubbefullskeletonanimated.x");
IAnimatedMeshSceneNode* draPlayer = smgr->addAnimatedMeshSceneNode(draPlayerSet);

draPlayer->setLoopMode(1);
draPlayer->setAnimationSpeed(30);
draPlayer->setFrameLoop(1,40);
-Ali

EDIT: Now i can tell that the skeleton is causing the error. Because i tried a small animation with the same mesh, without the bones and it worked.
Why is it like that? :( What does "Not matching normal and face index count " mean?
wyrmmage
Posts: 204
Joined: Sun Mar 16, 2008 3:12 am
Contact:

Post by wyrmmage »

This is somewhat of a shot in the dark, but Blender's .x exporter does not export indices correctly, at all. Could you perhaps upload your .blend file somewhere and I'll take a look at it? If it consists of multiple objects and/or bones then that might be the reason it's having problems. Basically Blender's exporter doesn't keep track of what vertices belong to what object, so when it writes the indices the numbering is way off.

I've written a patch, which I'll post if you'd like :)
-wyrmmage
Worlds at War (Current Project) - http://www.awkward-games.com
Ganadu'r, The Eternal Sage (Other Current Project) - http://rpg.naget.com
DarksideX
Posts: 22
Joined: Wed Dec 10, 2008 7:42 am

Post by DarksideX »

Here is the .blend file.

http://host-a.net/legg3r/bluerobot.blend

Thank you.

-Ali
DarksideX
Posts: 22
Joined: Wed Dec 10, 2008 7:42 am

Post by DarksideX »

Can someone please answer this question if you cannot answer the one above.

I just started using irrlicht and ive tried to implement animation with no sucess. Ive tried 3ds files, .x files, collada 1.4 (showed nothing), .obj files (exported 500 obj files XD with blender).

Please can someone tell me witch program i should use and wich format i shoulld export to so it works with animation.

Please help.

Thank you.

-Ali
wyrmmage
Posts: 204
Joined: Sun Mar 16, 2008 3:12 am
Contact:

Post by wyrmmage »

One thing you may want to try is to export your file from Blender into whatever format, start a new project, then import your file back into blender. This is one way to verify that Blender is writing exporting your object correctly (trying this with the .x exporter is a good laugh :lol: ). I'll upload my updated DX exporter when I get back to my laptop, but I don't know if it will help you or not, since I haven't played around with animation using it.
-wyrmmage
Worlds at War (Current Project) - http://www.awkward-games.com
Ganadu'r, The Eternal Sage (Other Current Project) - http://rpg.naget.com
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

Does your X mesh display correctly in Microsoft Mview?
http://dump.bitplane.net/mview.zip

If so you can use the old version of mview (5.4) to save the mesh, this usually fixes problems. If not then the exporter is at fault.
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
DarksideX
Posts: 22
Joined: Wed Dec 10, 2008 7:42 am

Post by DarksideX »

Well now i know that blenders .x exporter is at fault because i could neither import it back to blender or to Microsoft Mview.

Well.. Umm.. Wich program do you guys recommend me to use then for modeling and animating? Should i give up on blender?

-Ali
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

I think you just need to learn the problems with the X exporter, perhaps you're doing something it doesn't like. Check the FAQs forum for other people's experiences.

You can use X, B3D and MilkShape 3D for bone-based animated meshes, MD2 and MD3 for 'tweening animated meshes. All other mesh formats are not animated.

You may have more luck with the B3D exporter for Blender:
http://www.gandaldf.com/
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
wyrmmage
Posts: 204
Joined: Sun Mar 16, 2008 3:12 am
Contact:

Post by wyrmmage »

Here's my patched-up DirectX8Exporter; hope it helps :)
-wyrmmage
Worlds at War (Current Project) - http://www.awkward-games.com
Ganadu'r, The Eternal Sage (Other Current Project) - http://rpg.naget.com
Post Reply