Page 1 of 2

.x file exporter for Maya

Posted: Fri Feb 24, 2006 12:09 pm
by MarkusBergqvist
Hello

A while ago I searched for a free .x file exporter for Maya and did only find the one included in the DirectX SDK which is terrible from Maya 6+. So I wrote an own MEL script exporter with a friend. It is developed specifically for the Irrlicht engine (does only export data that Irrlicht can read).

Here it is: http://www.markusbergqvist.se/XExporter ... r.v1.2.zip

I did notice that Irrlicht comes with no exporter for maya so, niko, if you want to include this exporter in the Irrlicht package, you are welcome to do so.

All opinions/bug reports/suggestions are very welcome!

Cheers

Posted: Mon Mar 20, 2006 5:58 pm
by MarkusBergqvist
Did just notice that the GUI window is too small when it loads, you will not see all options if you do not resize the window. Maya will remember the size of the window the next time you open the GUI so you just have to resize it once (and thats the reason I did not noticed the "bug" before).

Posted: Mon Mar 20, 2006 7:19 pm
by vermeer
Thanks!


Not a maya user, but I collect everything x related. :)
Well, I collect everything.

Posted: Sun Mar 26, 2006 11:20 pm
by MarkusBergqvist
XExporter v1.3

Did some updates to the exporter, some small fixes and I added support for quaternion keyframes.

http://www.markusbergqvist.se/XExporter ... r.v1.3.zip

Cheers

Posted: Wed Mar 29, 2006 8:01 am
by green.t
Sweet! Will let you know if I run into any problems! (Seems great so far!) Thanks! :D

Posted: Sun Apr 02, 2006 6:14 am
by Browndog
I'm currently using the DX SDK exporter and its seems fine what exactly is wrong with it?

Posted: Sun Apr 02, 2006 10:38 am
by MarkusBergqvist
Browndog wrote:I'm currently using the DX SDK exporter and its seems fine what exactly is wrong with it?
first, it exports everything in the scene like the four cameras (which will not be visible in irrlicht) and second, it exports keys for every frame in the timeline and for every object regardless if they have any keyframes set by the user and it also exports data that Irrlicht can not read (decl data and vertex duplication list..). It works, yes, but as an game programmer I always want to optimize everything and just knowing there is alot of useless data in the .x file makes me sceptical and you can not choose to not export this data.

I'am trying to develop a dynamic loading rutine and therefor it is very important to have as less data to read from the harddrive as possible for me but for your application, especially if it does not load very many or large files, the DX SDK exporter may work just fine.

I was about to make some benchmarks on the two exporters but I was too lazy to download and install the latest DX SDK :roll: hopefully someone else want to do that.

Cheers

Posted: Mon Apr 03, 2006 4:57 am
by Browndog
ok thanks, I will give it a shot next time I export a model. I have notice how much rubbish is put into the .x file by the SDK exporter, yours sounds much better. Keep up the good work :).

Posted: Fri Apr 07, 2006 11:09 am
by Guest
Doesn't work for me. I always get this error message:

"Error: Collection not found, or no current collection."

It's a 508 triangle character with one texture map and maximun 2 vert weights. I'm using Maya 4.5.

Also, the window doesn't clean up after itself if it fails to start:

"Object's name is not unique: XExporterGUI"

Posted: Fri Apr 07, 2006 4:50 pm
by MarkusBergqvist
Thanks for the bug report!
I will look at your problem, for now I think it's maybe due to the version of Maya you use, I have only tested the exporter on Maya 7.0. The window problem is known but I dont know how to catch errors in MEL so I dont think I will solve the problem. Well, if the exporter dont work one would not use it and there is no meaning having advanced error checking =). More common errors are of course handled.

btw, do you have any idea on which command that reports the error?

Cheers

Posted: Fri Apr 07, 2006 9:01 pm
by MarkusBergqvist
Guest: did some research and found a possible fix for your problem. I would very much appriciate if you could test it on Maya 4.5.
Here is the file: http://www.markusbergqvist.se/XExporter ... aya4.5.mel
and this file you must drag and drop into Maya because the filename does not match the main function in the script.

Thanks

Posted: Mon Apr 10, 2006 4:13 am
by snowfly
It's great that you're looking into making it run on older versions of Maya! Much appreciated! The exporter runs now. Here are a few test cases..same model as before, and tested in the DX8.1 mesh viewer.

Mesh - OK; opens in viewer

Mesh+Material - Doesn't recognize lambert and blinn; opens in viewer without texture

Skeleton - OK; opens in viewer. Heirarchy is intact.

Mesh+Skeleton - Export completes; does not open in viewer

Mesh+Skeleton+Skin - Exporter hangs on "Writing skin data..."
Progress bar skips ahead to full and gives the error: Cannot find procedure "firstParentOf".
Export does not complete.

Posted: Mon Apr 10, 2006 4:16 am
by snowfly
when i do a google search for "firstParentOf", i get this cryptic search result. the page it links to doesn't exist tho.. :(
"I have overlooked that firstParentOf is not a built-in function. it is a custom script and as such it performs poorly. so in the final benchmarked version I ..."

Posted: Mon Apr 10, 2006 4:51 am
by snowfly
I got the Microsoft .x exporter plug-in instead (recompiled for my version of Maya). Thanks anyway!

Posted: Mon Apr 10, 2006 10:03 pm
by MarkusBergqvist
snowfly: Thanks for reporting those tests. I know there is problem with the DX viewer but I programmed the exporter mainly for my Irrlicht projects so I did not put much effort in making it work with the DX viewer. But the "firstParentOf" problem is interesting thou, I have not found any documentation of which MEL commands is avalible in which Maya versions and therefor I dont know compability of the exporter. But if I replace the firstParentOf command I am almost sure that the exporter at least works down to Maya 4.5, thanks to your testing.

Cheers