Jump to content
  • Advertisement
Sign in to follow this  
oxygen728

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

This topic is 5402 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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...

Share this post


Link to post
Share on other sites
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).

Share this post


Link to post
Share on other sites
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!



Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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,...)

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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...

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
http://www.ewertb.com/maya/mel/mel.php?howto=39

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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)...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!