Loading .x files exported by Blender

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
durney
Posts: 2
Joined: Tue Aug 15, 2006 1:47 am

Loading .x files exported by Blender

Post by durney »

I have run into problems loading .x files that are exported from Blender. I read several posts on this subject, and tried the two most recently posted exporters (Ben Omari's and the 2.42 exporter). I started out using Irrlicht 1.0 on a Windows system, compiling with gcc. I used the 01.HelloWorld example as a base and added code from other tutorials to use the FSP camera and a light.

I started out by exporting simple objects (a cube and a sphere), and they were not displayed correctly. The cube looked ok, but the sphere was cut in half or otherwise deformed. I also tried a more complicated spaceship model. It was fairly close to being correct, but was not completely correct.

I spent a lot of time trying different things with the Blender exporters and looking in the forum. I read Ben's documentation for his exporter.

I found one thread in this forum ("blender .x export") where someone suggested installing patches or getting Irrlicht from SVN, so I decided to try using version 1.1 of Irrlicht. Unfortunately that was a step backward for what I was doing, because none of my Blender-exported .x files would display at all with version 1.1. I get messages that say:
Unknown data object in material list in x file: ;;
and
Mesh without material found in x file.

Out of curiosity I tried looking at the x files in the mesh viewer that comes with the Direct X SDK, and they looked fine there.

I also tried exporting from Blender in Wavefront .obj. With Irrlicht 1.0 I got the geometry but no colors (no materials). With 1.1 I got colors, but they seemed to be inverted (blue showed as yellow, cyan showed as magenta) or otherwise changed.

I also tried loading a .x file that I made with Milkshape, and that looks pretty good. I couldn't see any difference between the 1.0 and the 1.1 version for it.

Can anyone help with these .x loading problems? Or explain why the Blender-exported files would partly work with Irrlicht 1.0 but not show anything with 1.1? I would much prefer to use Blender because a lot of the time I use OS X, for which Milkshape is not available.
Thanks,
Brian Durney
juliusctw
Posts: 392
Joined: Fri Apr 21, 2006 6:56 am
Contact:

i know how you feel

Post by juliusctw »

i know how you feel :(


I have been having trouble with blender for 7 month now, there are some people that claims that it work, but i have never done it. Vermeer has offered a lot of help in this topic, but nothing i do seemed working,

would you please please email me if you got it working some how , and please please write a tutorial
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post by vermeer »

[ot]julius, are u the one who left the job of satellites to work in irrlicht projects? I have bad memory [/ot]

Well, I feel bad for that. I guess you have tried a lot of things already. To me it was allways fixable to make it work, but true that i count on several tools to treat the exported blender x file, and that I know the format's tricks since a while...Apart from available time, my usual prob is that..I never know every single step done in the workflow, and besides 3d is allways so, in x format there's a bunch of steps to make an error, even more for irrlicht.

Only way I *may* be able to help in these cases (I hope it's taken in consideration for future askers...Oh, well, another stuff to make sticky...or put in the top of an x sticky thread...) is...if the suffering user puts all his steps done...Pitty is...some of the bad errors are unoticed, the person doesnt kno it's a critical thing, so they may not even mention.

Generally, knowing all steps done in mesh and scene building, materials and bones naming, etc, gives us(others here are succesful in this) a clue...But there's 80% of possibilities of never spotting where user gave error, even while we may have a 100% in getting an x correct, as we just do a safe procedure.

Most times is the mesh a bit ambitious. I don't criticize it, but take in consideration the format you are using. Collada or md5 are way more powerful.

Indeed, for character animations, while x works great for me, I am seing once and again it's md5, the export from blender is direct and simple.

Collada is a bit young yet in Blender, am afraid.But a route to go, imho, to.

And a pitty there's no b3d exporter out of Blender yet. Luke seems to have done a powerful solution for irrlicht with it.
Out of curiosity I tried looking at the x files in the mesh viewer that comes with the Direct X SDK, and they looked fine there.
You looked at it, but did you save it there as x, again, and then tried to load in irrlicht? I know is obvious question, but quite important.

Anyway, take care that your materials have not got punctuantion ("." "-") in it...dunno which is the more offending, but seems there's problems there too. Also with ur bone names, which Blender has the habit to put a "." in the middle (Bone.001) .I even remember doing a replace all with Wordpad, "Bone" insetad of "Bone." :D
Jox exported did killed that, but I think Ben's already does it too, unsure.

don't build with several meshes, check four doubles (themesh must be solidly welded) before weighting(adding armatures) , triangulate the mesh before too. And well, you seem to be already following all Ben's doc.You need also to bake the anims. For me the key here was start the anim, but before doing any keyframe, baking it, other wise later on would not let me bake as it used to allow...Once you work in baked anim (I think at the end u needed to hit bake button again) u can export as well stuff animated using complex c0nstraints as I do. (with Md5 format, Der Ton's exporter does consider the Pose mode new code thing in Blender, so it does not need the bake stuff.)

As i say, I have several x tools, like U3d, mview, which save as usually a irrlicht friendly file. To me is one of the best ways to go, but not the only one.

Md5 Blender exporter works great in other engines, and statistically seems would be better fo rthe users...Besides I guess x will stay there for those already basing all their workflows in x already.
Finally making games again!
http://www.konekogames.com
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

It's always good to provide the files not working for download, or mail them to me. I simply can only test the files I have access to.
juliusctw
Posts: 392
Joined: Fri Apr 21, 2006 6:56 am
Contact:

Post by juliusctw »

Hola Vermeer

Si, yo soy el chico que dejo' mi trabajo de radar. Sigo trabajando con mi proyecto. Todo bien conmigo, he conseguido algunas personas que me ayudan con dinero y espero que termino dentro de otra año. "espero"

Tengo questiones con lo que has mencionado,

you said that collada and md5 are more advanced, do they contain animation info like x and md2?

i checked blender and i saw collada, but no md5, at this point, i really don't care what format i use, as long as I can do animation, and export it to irrlicht, i will be happy,

I have tried to export 3ds, md2, and x from blender, i never got a single one to work, besides obj format, (but obj doesn't contain animation)

which format is the most straight forward to export from blender to irrlicht ?

thank you for your help
dhenton9000
Posts: 395
Joined: Fri Apr 08, 2005 8:46 pm

Post by dhenton9000 »

for what its worth i get .x to export from blender very easily, unfortunately, I have to use blender 2.37a, and the jox .x exporter. It works great its, just two versions behind :(

I have yet to get the Omari exporter to work consistently in 2.42, its tempermental with respect to irrlicht. I think it does better for other environments. Omari doesn't write his exporter to specifically satisfy Irrlicht. I think there are some Irrlicht specific quirks to it.
CodeWarrior
Posts: 2
Joined: Tue Oct 17, 2006 12:14 am

Post by CodeWarrior »

Hey vermeer, you just said you did that bake stuff with omari's exporter. I tried that also, but I never got a working animation exported. Always all my keyframes were like the first one!
I also got big problems with Irrlicht and .x files - at first it doesn't work at all. Now I use Irrlicht 1.1 and the most bugs are fixed. But there are still some things so you have to look over the file manually :(

It would be great if you can give me some hints of how to export my model with a baked animation that hasn't only duplicated the first one. If you like I can send you my file, if it would help ^^
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

Try blender 2.41 with the new exporter (v3), and also try the latest SVN build.
Here's a little test pack for testing Blender X exporting, it contains irrlicht, meshviewer, mview and the latest X exporting script.
Read the readme.txt and send meshes that don't work in irrlicht but do work in mview to me by email

http://bitplane.net/dump/temp/irrlicht_ ... x_test.zip
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
CodeWarrior
Posts: 2
Joined: Tue Oct 17, 2006 12:14 am

Post by CodeWarrior »

Finally I brought it to work with Omari's exporter and Irrlicht 1.1
If anyone has some questions I will kindly reply...
xhyldazhk
Posts: 4
Joined: Mon Aug 29, 2005 5:53 pm

Post by xhyldazhk »

Exactly how? I've struggling with Linux and all exporters, and I can't get anything to export... I'm an Irrlicht newbie...
xhyldazhk
Posts: 4
Joined: Mon Aug 29, 2005 5:53 pm

Phewww...

Post by xhyldazhk »

I've done it. With current Blender 2.42a and its DirectX exporter.

The main problem for me was that the exporter exported the MeshMaterialList ending in double semicolon (;;) but Irrlicht expected it ending in semicolon (;)
I simply searched for the function that exports the MeshMaterialList inside the python script, modified the termination in the 2 places where it is written, and voilá!!

I hope to be helpful.
Post Reply