exporting maya files

Started by
7 comments, last by RobTheBloke 19 years, 7 months ago
I have this problem when exporting Maya files everytime I export it in .obj the result is strange, it looks like some parts of the model aren't there This is why I think there is some problen with my .obj exporter. Is there anyway this thing could happen apart from problems with the exporter and is there anyway to solve this thank you By the way I'm using GeforceFX 5900 and 1GB of Ram so I don't think the problem could come from my machine.
Advertisement
The maya exporter should be fine. Does you loader take account of meshes that have no tex coords?

ie, the faces can look like

f 1/1/1 2/2/2 3/3/3

or

f 1//1 2//2 3//3

if there are no tex coords. try loading the obj in another viewer or back into maya with the import plugin. Also make sure you have used export all rather than export selected. You might find a few useful maya resources on my website... www.robthebloke.org
Another thing to look at, apart from not completely handling the OBJ format, is triangle winding. If you're using DirectX (right-handed system), try turning off polygon culling (at least temporarily) to see if that's the source of your problem.

It may not be that your OBJ is missing triangles, but that your renderer just isn't drawing them.
or it may just be that you've got the normals inside out on the model and have back face culling on
Thankyou for all of your advices I very appreciate it theproblem is I don't know how to disable polygon culling and if there are problems with the normals as you said how do i fix it? Can you help me a bit further here? thanks
there are lots of different formats in the obj file for faces, it can store triangles or quads, which would need to be triangulated for directx - make sure this is working correctly.

otherwise, what version of maya are you using? with 4.0 the obj exporter works great, as i use it in my own projects. the texture coordinates are pretty screwed up sometimes, but that wouldn't be the cause of your problem.

to disable polygon culling in directx use SetRenderState( D3DRS_CULLMODE, D3DCULL_NONE ), and the normals could have any number of problems, so i can't help you there.
Chris PergrossiMy Realm | "Good Morning, Dave"
I agree with c t o a n. If you're using DirectX, his code will disable culling and alleviate any triangle-winding / polygon normal direction issue. If you're using OpenGL, I believe that you want glDisable(GL_CULL_FACE).

Both of those issues relate to the same problem: the renderer thinks the triangle is facing away from the camera, and thus skipping it.

In Maya, you can turn on face normals for your shape under 'Component Display' (I think) and it will display them in the viewport. It's important that these face normal vectors are pointing out of your shape and not into it.

If you uses c t o a n ' s code in your DirectX init and your shape is properly displayed then you know the problem lies with one of these two things.

If not, go back to what RobTheBloke said earlier about the OBJ format and make sure your handling the proper format for all your triangles.
Goto the display menu within maya, and in either the custom polygon display options enable normals, or within the polygon components bit of the display menu. All of the normals should be pointing inwards. If they are not, then select the faces that are inside out and on the edit polys->normals->reverse (can't remember exactly, haven't got maya open).

If it's not that, try the model in my loader code. That should handle any variation of face indices within the file. try opening the obj file in a text editor and serach for "//" "/ " (obviously without the ""). If you find any matches within the file then it's probaby that. If the code is derived from the source on gametutorials.com, then it will not handle normals - that may be why it's going wrong.

Alternatively, if you look at the bottom of the Maya Exporter Factfile, i have some exporter and loading code that handles textures, material data and animations as well....
sorry, the AP was me... www.robthebloke.org

This topic is closed to new replies.

Advertisement