3D Rad - Free 3D game maker - Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Coming soon: software updates

Pages: [1] 2

Author Topic: How To Export .X Files From MAYA  (Read 1141 times)

SUNCHIRP

  • Full Member
  • ***
  • Posts: 168
  • Digital Entertainment
How To Export .X Files From MAYA
« on: September 15, 2009, 03:16:35 AM »
MAYA TO 3DRAD


To export .X files from Maya, you will first need a DirectX .X file exporter.

You can download a version from the following website ( kindly provided by Chad Vernon ) : -

http://www.chadvernon.com/blog/downloads/cvxporter/

On the website is full instructions on how to install and run the exporter.


Step By Step Instructions On Exporting

1.  Within Maya, in your Settings / Preferences, click on Display and make sure your World Coordinate System is set to Y and that your Working Units is set to Centimetres, Centimetres may seem small, but 1 centimetre unit is equivalent to 1 normal unit in 3DRAD.  See image : -



2.  To ensure your working to a default unit size, go to Display > Grid and open the Options box, and set your sizes to the following which will ensure your grid display unit size is exactly 1 centimetre scale.  See Image : -



3.  Go to File > Save Preferences to save the settings for good, you will not need to perform steps 1 to 3 again.



4.  This isn't a tutorial on modelling, so I wil leave that in your domain, needless to say, create your model, assign your UV's, and once finished make sure you delete all history, remember to check for things like floating vertices, unmerged polygons, etc.

5.  If you have seen the tutorial on creating your own skinmeshes in 3DRAD here : -

http://www.3drad.com/importing.htm

you will notice that you create a directory first for your SkinMesh, for purposes of clarity and understanding, we will use for our example, a directory for our SkinMesh called Crate.  This will be an example of a mesh and texture, so within your 3DRad installation folder, you will find now find the following folder ( assuming the root of C is your installation drive, if not, browse to your installation folder )

C:\3D Rad\3DRad_res\objects\SkinMesh\Crate

Within that directory will be the default SkinMesh data, this consists of

000_em.dds
000_nm.dds
000_mesh.x
000_shadow.x
bluefish.bmp


Save your base Maya file into that directory as 000_mesh.mb ( or ma, depending on your preference for Maya Ascii or Binary files ).

000_mesh.mb is your Maya source file.  Save your texture to the same folder, for this example, we have used Crate.bmp

6.  C:\3D Rad\3DRad_res\objects\SkinMesh\Crate

For test purposes we only need to export a skinmesh and texture, so delete the following files from the folder : -

000_em.dds
000_nm.dds
000_shadow.x
bluefish.bmp


7.  Back within Maya, if you installed the .X exporter correctly, you will have it accessible via a shelf icon, select your object, in this exaple, our Crate object, and then select the .X Exporter shelf item, the UI for the .X exporter will open, now set the options as follows : -



It's very important that you have the following options unchecked, Tangents and Binormals, otherwise you will not get anything to appear in 3DRAD ( although it would display in external .X mesh viewers ).

Click on Export Selected, and browse to your folder, C:\3D Rad\3DRad_res\objects\SkinMesh\Crate in our example, select the default 000_mesh.x that already exists in there that we left from before, and click Save, this will overwrite the default version.

8.  Back in 3DRad, go to Objects > Add, the select SkinMesh, press Enter, then select to Change, then choose your new object, in our example, the Crate, if everything has been done, you will now be looking at your newly created skinmesh in 3DRAD.



Hope you find this tutorial useful.

Regards.





EDIT UPDATE : Boned Animation SkinMesh Procedure


To export boned animation from Maya, you follow a similar process.  Rig your model and create your animation.  Now there is two ways to export your boned animations directly out of Maya.  I will document both.

( A ) Multiple Animations

Multiple Animations can be achieved be creating your animation as you would usually, but keep a note of you keyframes, for example, you may have something like the following : -

Frames 01-24 = Character Walk
Frames 25-48 = Character Run
Frames 49-60 = Somersault

Now to export all these seperate animations on different keyframes to a different file, we invoke the CVXporter, and choose the following options with regards to animation : -



Then we add our first animation 'set', this will become our identifier within 3DRAD : -



Now click on Add Set twice more to add the other animations : -



Now, click on Export All, browse to your allocated SkinMesh directory and save your 000_mesh.x file there.  You would have needed to have set up a new SkinMesh directory at the beginning - see first tutorial for more information on how to achieve this.

IMPORTANT STAGE : -

Load your exported 000_mesh.x into MView.exe

http://users.skynet.be/fa201614/irrlicht/mview.exe

CVXporter exports animation, but not in a format that 3DRAD recognises, so we need to rectify this problem, once your 000_mesh.x is inside MView.exe, click Save As, and overwrite the original 000_mesh.x file, this will reorder the .X file correctly, and 3DRAD will now recognise the file as a file that contains animation.

( B ) Single Animations

To Export Singular Animations, we utilise the same process, create your animation, for example, a character walking, then we invoke our CVXporter, and set the following options : -



And once more, we add our animation 'set' to the exporter dialog : -



Then click Export All, and browse and save your 000_mesh.x to your allocated SkinMesh folder.  As before, we need to perform one more step before 3DRAD recognises our new SkinMesh as an animation, Load your exported 000_mesh.x into MView.exe, click Save As, and overwrite your original 000_mesh.x file.  Back in 3DRAD you will now have animated SkinMeshes.

« Last Edit: September 15, 2009, 10:54:15 PM by SUNCHIRP »
Logged

3D Rad Developer - Fernando

  • Administrator
  • 3D Rad Guru
  • *****
  • Posts: 3788
Re: How To Export .X Files From MAYA
« Reply #1 on: September 15, 2009, 03:54:50 AM »
That's great SUNCHIRP, thanx! I'm adding a direct link to this post to the importing tutorial  :)

Weapon121

  • Sr. Member
  • ****
  • Posts: 265
Re: How To Export .X Files From MAYA
« Reply #2 on: September 15, 2009, 06:30:28 AM »
One very important note though is that cvxporter is good for static meshes, it wont work with animated(boned) meshes. I have never gotten it to work with animations. An alternate method for exporting animated meshes is to get Ultimate Unwrap 3D. It comes with a Maya and Max plugin so you can export directly into the programs native format. Then once in UU3D, you can export to directx, flawlessly  ;)
Logged

SUNCHIRP

  • Full Member
  • ***
  • Posts: 168
  • Digital Entertainment
Re: How To Export .X Files From MAYA
« Reply #3 on: September 15, 2009, 08:41:05 AM »
Hi, Weapon21

I have no problems getting any animation out of cvxporter, see attached .x file ( I tried two ways, standard animation and baked animation ).  These are the options I used : -



I have attached the resultant .x file, which works in any viewer I test it with.

However, inside of 3DRAD, I've not done any animation tests, so when I load the skinmesh, I'm not sure how to trigger it to play, the animation panel inside the skinmesh options is greyed out, so you may actually still be right ( the exporter seems to work fine out of Maya ( and is viewable in any direct x mesh viewer ), but not into something 3drad can 'see' ?
Logged

3D Rad Developer - Fernando

  • Administrator
  • 3D Rad Guru
  • *****
  • Posts: 3788
Re: How To Export .X Files From MAYA
« Reply #4 on: September 15, 2009, 08:52:20 AM »
3D Rad only support matrix-based animation. I see the matrix setting is displayed on the dialog above. What happens if you export in matrix mode?

SUNCHIRP

  • Full Member
  • ***
  • Posts: 168
  • Digital Entertainment
Re: How To Export .X Files From MAYA
« Reply #5 on: September 15, 2009, 09:17:56 AM »
Hi, Fernando

Thanks, I wasn't aware of that.

I baked the animation onto the bones, and chose Export All, and chose Matrix.

It exports correctly, and is viewable in any mesh viewer, however, I still get a greyed out animation panel in the skinmesh properties inside of 3DRAD, really not sure why that would be happening though ?

I have attached a file containing two versions, standard export and one with baked keys, both work in the Mesh Viewer, I'm afraid I'm a little stumped on this one.  ???  How do I tell 3DRAD the file contains animation, or is it automatically picked up when it loads in ?
Logged

shadmar

  • 3D Rad Guru
  • *****
  • Posts: 765
Re: How To Export .X Files From MAYA
« Reply #6 on: September 15, 2009, 09:28:06 AM »
If it works in Frag it works in RAD, try it out in Frag and re-export from Frag and then RAD.

SUNCHIRP

  • Full Member
  • ***
  • Posts: 168
  • Digital Entertainment
Re: How To Export .X Files From MAYA
« Reply #7 on: September 15, 2009, 09:43:32 AM »
Hi, shadmar

I tried it through Fragmotion, which works fine also, but again, greyed out animation panel in 3DRAD.

I noticed in Fragmotion, I had to select the Man_Animation set before playing, otherwise it played nothing but the default pose.  I'm wondering if I need to script and select the Man_Animation set in 3DRAD to actually get it to play, can anyone confirm that animations are automatically picked up on import in 3DRAD usually, or whether I need to script it ?
Logged

3D Rad Developer - Fernando

  • Administrator
  • 3D Rad Guru
  • *****
  • Posts: 3788
Re: How To Export .X Files From MAYA
« Reply #8 on: September 15, 2009, 10:12:44 AM »
How do I tell 3DRAD the file contains animation, or is it automatically picked up when it loads in ?

It's automatic. If there is animation 3drad can read, the controls will be activated.

Thanx for the 'matrix' test. I think the exported file doesn't really include matrix-based animations, even if 'matrix; option is checked. But it's hard to tell because there are just too many ways to 'format' an .x file  :-\

shadmar

  • 3D Rad Guru
  • *****
  • Posts: 765
Re: How To Export .X Files From MAYA
« Reply #9 on: September 15, 2009, 10:20:12 AM »
Hi, shadmar

I tried it through Fragmotion, which works fine also, but again, greyed out animation panel in 3DRAD.

I noticed in Fragmotion, I had to select the Man_Animation set before playing, otherwise it played nothing but the default pose.  I'm wondering if I need to script and select the Man_Animation set in 3DRAD to actually get it to play, can anyone confirm that animations are automatically picked up on import in 3DRAD usually, or whether I need to script it ?

Did you re-export it from frag also ?

EDIT: also send or post the .x and I can check it out for you.
« Last Edit: September 15, 2009, 10:23:54 AM by shadmar »
Logged

SUNCHIRP

  • Full Member
  • ***
  • Posts: 168
  • Digital Entertainment
Re: How To Export .X Files From MAYA
« Reply #10 on: September 15, 2009, 12:43:41 PM »
Hi,

Sorry for the wait guys.

shadmar : Yes, I had re-exported it from Frag, and got the same problem.  I think it was because I was maybe using an older version - 0.91.


Anyway, after some further testing, I've finally managed to figure it out, when I load the mesh into my Mesh Viewer, mview.exe ( available on these forums, or here ) : -

http://users.skynet.be/fa201614/irrlicht/mview.exe

I simply go to Save Mesh As from mview.exe, and overwrite the original version,  this must reformat the structure of the .x file, and after saving, the mesh works with full animation inside of 3DRAD.  It's an extra step in an art pipeline, but not so bad if it gets the job done.

Yay! :)
Logged

shadmar

  • 3D Rad Guru
  • *****
  • Posts: 765
Re: How To Export .X Files From MAYA
« Reply #11 on: September 15, 2009, 12:53:43 PM »
Great :)

But... Frag never failed before, I don't believe it.. what were your export options in frag ?
Exactly like this (pic) ?

EDIT: also 0.96 is the current, i know AllanF had some troubles with an older version.
« Last Edit: September 15, 2009, 01:03:30 PM by shadmar »
Logged

SUNCHIRP

  • Full Member
  • ***
  • Posts: 168
  • Digital Entertainment
Re: How To Export .X Files From MAYA
« Reply #12 on: September 15, 2009, 01:21:17 PM »
Pretty much the same options as you : -



I'll point out though, that this file exported from FragMotion can also be fixed using MView.exe.


I'm quite happy with the process I have in place, Maya, CVXporter and MView, now that I have confirmed pipeline compatability.  I've invested too much time in Maya right now to change to another package.
Logged

shadmar

  • 3D Rad Guru
  • *****
  • Posts: 765
Re: How To Export .X Files From MAYA
« Reply #13 on: September 15, 2009, 01:26:53 PM »
Please try it on 0.96 or send me the mesh so I can sleep, I always answer frag as the ultimate export saver when ppl ask or have problems with their .x ;)

EDIT: You forgot Add Root_Frame!
« Last Edit: September 15, 2009, 01:29:57 PM by shadmar »
Logged

SUNCHIRP

  • Full Member
  • ***
  • Posts: 168
  • Digital Entertainment
Re: How To Export .X Files From MAYA
« Reply #14 on: September 15, 2009, 01:32:54 PM »
Yup, shadmar

Seems to be working with the Add Root Frame option selected! :), you can go to sleep now!   :)

So, it seems the CVXporter works fine for static meshes, but animated meshes require a little bump in the right direction with MView.exe

Thanks for all your help.
Logged
Pages: [1] 2
« previous next »