Maya 6.0 - Directx (.X) Exporter -- Where did my vertex color go?

Started by
9 comments, last by oxygen728 19 years, 6 months ago
I moved this thread here from Visual Arts since it has very little to do with art... Well, the files that I use for exporting are here: www.oxygen728.com/xExport.zip I went through all of the trouble learning MEL ... I wrote a nice routine that changes vertex colors based upon their elevation. Now I find out that the exporter doesn't even export vertex colors, in any way? (I hope I'm wrong about this) I hope somebody can suggest a way of overcoming this problem. Thanks for the help. P.S. If nobody comes up with a snazzy fix for this... I guess I'll just clone my mesh in directx (c++) and calculate all of the vertex colors through code. I feel like I shouldn't have to do this after working with maya though...
Advertisement
By the way... I did fool around with the Exporter Options in Maya... strangely there is no option to include colors (I would think it would be default anyway).

For whatever reason, the Directx people decided to call it quits on the Maya exporter and not even bother with exporting vertex colors.


I have no idea how to fix this... a lot of the code in this file is almost impossible to read - horribly commented.



This is code from the actual exporter:

// MeshVertexColors
// hr = AddVertexColors(pShape, pShapeDataObject, pxofSave),
if (FAILED(hr))
goto e_Exit;

They just comment out the call to export colors.

This was obtained from:

XportTranslator.cpp in the C:\DX90SDK\Extras\Direct3D\Plug-Ins\Maya version 4.0 and 5.0\ directory.




Yes, i did try to uncomment it.. but to no avail.

I'm mad at the person responsible for this!



in my opinion someone should write a .x exporter with mel. would be much less trouble! ;) (no need for recompiles, easier to adapt it to your own needs,...)
Would be pretty nice =)

I've spent far too much time on this as it is... I'll probably end up doing just that one of these days.

I really don't want to fork over 300 bucks for poly-trans.

X Files are template based from the beginning.
There are templates for vertex colors for sure.
All exporters for .X files are very buggy. Don't know why microsoft does not fix it.

You could write just a VERTEX COLOR exporter and paste it to the ASCII .X File.
If Maya could print floating point numbers properly, it would have been done already. The D3DX X file importers don't like exponential form floating point numbers, nor do they like floating point numbers without a decimal place eg. 1 vs 1.0
I'm currently writing one using the SDK for this very reason. The other problem you'll come across is duplicating certain vertices based on soft/hard edges where a particular Maya vertex has 2 normals or 2 vertex colours etc. Not fun.
fixing mel's floating points is easy (just write a rounding function) and i think splitting the vertices at hard edges is quite easy too. ;) i think a mel .x exporter wouldn't be very difficult to write...
http://www.ewertb.com/maya/mel/mel.php?howto=39
i am not sure if these function also fix floats without any decimals but if not they can be fixed too (i guess with some regular expressions)...

This topic is closed to new replies.

Advertisement