Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

FBX file won't import properly

Discussion in 'Editor & General Support' started by prabab, Apr 23, 2014.

  1. prabab

    prabab

    Joined:
    Apr 10, 2013
    Posts:
    9
    Hi. I have a problem with importing this simple, non-animated model made with 3ds max.

    It should look like this:
    $aPORWcX.png

    However, for some reason Unity imports it... like this.
    $yTw8VrX.png

    When I try to export it as an OBJ file the Unity freezes while trying to open the file.

    The model however, FBX and OBJ, opens without any issues in other apps, such as Blender, or my simplistic LibGDX model viewer. So I'm definitely doing something wrong within the Unity. But what?

    Please help.

    Cheers,
    Kamil
     
  2. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,738
    These are a little bit long-shot, because I don't see anything immediately obvious.

    It looks like your model is mostly quadrilaterals; you might try triangulating in your 3D editor before exporting. I think Unity handles quads on import, but it might not do so reliably.

    I notice in your inspector screenshot, the position of the transform is in the thousands. Is that where it is in your 3D model file? If so, you should edit them closer to the origin; large numbers like that can cause floating point imprecision errors, which might account for models importing bizarrely.

    Finally, there's an error message in your console (red stop sign at the bottom of the window), but I can't get anything useful from that error message at that small size. Are there any other error messages if you expand the console? If so, what?
     
  3. prabab

    prabab

    Joined:
    Apr 10, 2013
    Posts:
    9
    I have triangulated the meshes, nothing has changed unfortunately.

    The model is in the centre of the all axes in 3ds max, something goes terribly wrong only after the import.

    $ugh.png

    "isFinite(outOfDistanceForSort)".

    The error prints every time I select the broken model in the Unity Editor. I guess it's because its coordinates are broken when imported, or something like that.
     
    Last edited: Apr 23, 2014
  4. twiesner

    twiesner

    Joined:
    Oct 4, 2011
    Posts:
    309
    I believe the error "isfinite( outdistance for sort )" usually refers to an object far bigger than Unity can handle it is having issues rendering it. Have you tried scaling the model down in a 3d software and re exporting? Or adjusting the mesh importer scale?
     
  5. twiesner

    twiesner

    Joined:
    Oct 4, 2011
    Posts:
    309
    if you are using max what is your system unit setup?
     
  6. prabab

    prabab

    Joined:
    Apr 10, 2013
    Posts:
    9
    1cm = 1 unit, the same in export settings.

    The model is 34 units wide, making it smaller didn't change anything, it's still imported as a set of bright green planes with infinite dimensions :S.

    I've tried setting the scale factor in import settings, but to no effect.
     
  7. twiesner

    twiesner

    Joined:
    Oct 4, 2011
    Posts:
    309
    In max apply a stl_check modifier to the model and in the parameters turn on "check". See if it tells you if there are any hidden errors in the mesh.

    If you have max2012 or up, maybe give this script a try scriptspot model checker. Works like the stl_check.
     
    Last edited: Apr 23, 2014
  8. prabab

    prabab

    Joined:
    Apr 10, 2013
    Posts:
    9
    This method has found a lot of errors, apparently with "open edges", thank you so, so much!

    Is it bad that I've removed the faces that won't ever be seen in-game? Do I need to leave all the brushes closed to have it imported properly to Unity? Also, all the planes are shown as erroneous, what should I do with them?
     
  9. twiesner

    twiesner

    Joined:
    Oct 4, 2011
    Posts:
    309
    Most of the time you can ignore the open edges error if it was intentional to leave parts of the mesh open. Did the stl check show anything regarding double faces, spikes, or multi edge?

    Last fix I can think of that might help is to reset the xform of the model.
     
  10. prabab

    prabab

    Joined:
    Apr 10, 2013
    Posts:
    9
    No other errors were found.

    How do I do that?
     
  11. twiesner

    twiesner

    Joined:
    Oct 4, 2011
    Posts:
    309
    Click in the Utilities tab in the inspector. If it isn't in the list, click on configure sets and drag it into the button list. Don't know why Autodesk hasn't added it to the modifier list.