XNA Creators Club Online
Page 1 of 1 (8 items)
Sort Posts: Previous Next

Weird issues when exporting from Maya to FBX

Last post 07-21-2008 6:17 AM by JonHumphreys. 7 replies.
  • 05-05-2008 10:04 PM

    Weird issues when exporting from Maya to FBX

    So I got a few models in Maya. I try exporting them into FBX and then to simply display them in my XNA project. When the model lodes up in my XNA program, it is as if the object is one-sided with the face normals pointing the wrong way. I have tried many, many things to fix this.

      1. Delete ALL history in the scene
      2. Group all polygon objects (meshes) under one master group node
      3. Freeze transformations on all objects
      4. Combine all objects into a single mesh

    Some of these (or a combination of) create even weirder effects - such as certain objects being rotated/translated dramatically.  The weirdist thing is (with the main issue -- seeing through parts of the model) is when I import it back into Maya (2008 x64) it looks correct.

    Has anyone else had issues like this? I was wondering if the following things might have anything to do with it (Note: these are more general questions - the models in question may or may not reflect some of these potential issues):

      1. XNA support for double-sided objects
      2. Polygon quad or N-sided geometry support (non-triangulated geometry)
      3. Concave/Convex/Nonmaifold geometry
      4. Geometry that dosn't have UV's associated with it
      5. UV's that extend beyond the normal 0,0 -> 1,1 space
      6. Materials support (what is and isn't supported - and how complex you can get in shader networks (what nodes are supported))
      7. Surfaces support (Does XNA support NURBs or SubD geometry? or does it all need to be converted back to polygon?)
      8. Multiple UV maps
      9. Texture support for images larger than 2048x2048
      10. Hard/smoothed edges
      11. Per-vertex normals
      12. Multiple shaders/mesh(object) (assigned per-face)
      13. How single-sided (+/- opposite flag) and double sided objects are handled

    I'm very expenienced with Maya and decent in C#, just learning how to make XNA games. I've been very surprized that I havn't been able to find anyone else complain about issues similar to what I'm having. Any feedback would be greatly appricated.

  • 05-05-2008 10:14 PM In reply to

    Re: Weird issues when exporting from Maya to FBX

    I have seen the normals probelm happen heaps of times using Blender and FBX into XNA, the main problem has been the way that the normals have been setup on the model. With Blender showing the normal in the editor shows that as the double side effects are on and some of the normals are facing inwards. Recalculating the normals to outside fixes the problem.
  • 05-05-2008 10:46 PM In reply to

    Re: Weird issues when exporting from Maya to FBX

    I decided to go back to the basics - I created a simple PolyCube and did a few extrudes on it. I deleted the history - ran PolyCleanup and checked the normals. It's a "perfect" model. I uploaded the Maya file (I put in the ascii format so those with versions earlier than 2008 can simply open it in notepad and change the version requirement) and the FBX it exported. I can not for the life of me figure out what I'm doing wrong.

    Download the model at http://www.kentwilliams.net/box.zip.

    Here's a picture of the box rendered from my XNA project (imagine a trash can) -- the "inside bottom" is somehow drawing over the sides & top... At one test, I deleted the problem surface and it seemed to "fix" everything - except now I can see through the bottom. I then undid that and tried to "seperate" the face into a seperate mesh -- still had the problem. I then deleted the suface again and this time reversed the normals on the "outside bottom" (so it would hide the hole created from the inside bottom being deleted) -- however, the problem came back.

  • 05-06-2008 1:51 AM In reply to

    Re: Weird issues when exporting from Maya to FBX

    I can not get to the models here at work, and will have a look when I get home. But are the seperate parts different objects, you might want to have a look at the pivot points for the bojects and make sure that they are correct and relate to the centre of the object.

    As I said I will have a quick look when I get home to see if I can see anything else.

  • 05-06-2008 3:16 AM In reply to

    Re: Weird issues when exporting from Maya to FBX

    The model I really want to use is over 100 seperate polygon objects - and most of the pivot points do not match up - I can understand that would cause certain objects to show up in weird places. However what I can't wrap my head around is background polygons being rendered on top of the foreground ones - as in this box experiment. Thanks for your input.
  • 06-21-2008 11:24 PM In reply to

    Re: Weird issues when exporting from Maya to FBX

    looks like your normals are fine except for that bottom section... I'd check that again.

    It could also be a problem with the vertex order of the polygons...   e.g. eanticlockwise triangles instead of clockwise or vice versa.

    There are only 10 kinds of people in the world. Those that know Binary, and those that don't.
  • 07-03-2008 8:46 PM In reply to

    Re: Weird issues when exporting from Maya to FBX

    Have you played around with the Culling your using in XNA?
  • 07-21-2008 6:17 AM In reply to

    Re: Weird issues when exporting from Maya to FBX

    KentDub,

    I've had this happen to me in the past (Maya 2008, Vista x64).  In my case, the problem had to do with mirroring a piece of geometry (by duplicating with a negative scale transform).  This caused the geometry to be read as inside-out by XNA, even though it looks fine in Maya.  I suspect you already tried this, but here's what fixed my issue:

    • In Maya, turn off "Two sided lighting" by clicking on the "Lighting" drop-down menu in your perspective panel (or whatever panel you're using to view the model in) and removing the check next to "Two sided lighting."  The "Lighting" menu is in the little menubar attached to each panel (not the main menu bar that has "File, Edit, Modify, Create" etc.  With two sided lighting on, you won't be able to tell if meshes are inside out.
    • With two sided lighting off, you should now be able to see any problem meshes.  These meshes will be completely black.  If you don't see any black meshes, or if you know a mesh is giving you trouble but it doesn't look black, try the steps below on that mesh anyway.
    • Select a problem mesh.
    • Freeze transformations on the mesh (Modify -> Freeze Transformations).  You may or may not get a warning (pink text in the lower right notification area of your Maya window) telling you that freezing transforms on geometry with negative scale can cause problems, blah, blah, blah.  Ignore this.
    • With the mesh still selected, open the mesh's attributes (Ctrl-A)
    • In the attributes window, expand the "Render Stats" entry
    • Under Render Stats, see if the "Opposite" flag has been checked.  If it's not checked, well, this isn't going to help you.  But if it IS checked...
    • It'll be checked but greyed out.  To be able to uncheck the opposite flag, you first need to uncheck the "Double Sided" flag just above it.  Then, uncheck the opposite flag and re-check the double sided flag.
    • Now, your mesh is fixed, but its normals are reversed.  To fix this...
    • With the mesh still selected, do Normals -> Reverse.  (This is under the Polygons menu set, in case you don't have that menu set active.)
    • In theory, that should take care of it.  In theory, of course.
    For the record, here's a mel script that does all the above stuff for you.  Just select the mesh and execute this script:

    global proc reverseObjectJh()
    {
        string $selObj[ = `ls -sl`;
        eval("setAttr " + $selObj[0] + ".doubleSided 0");
        eval("setAttr " + $selObj[0] + ".opposite 0");
        eval("setAttr " + $selObj[0] + ".doubleSided 1");
        eval("polyNormal -normalMode 4 -userNormalMode 0 -ch 1 " + $selObj[0]);
    }

    Hope this helps you (or someone else in the future).

     


Page 1 of 1 (8 items) Previous Next
var gDomain='m.webtrends.com'; var gDcsId='dcschd84w10000w4lw9hcqmsz_8n3x'; var gTrackEvents=1; var gFpc='WT_FPC'; /*<\/scr"+"ipt>");} /*]]>*/
DCSIMG