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

Maya LT normals/hard edges don't export into FBX.

Discussion in 'Asset Importing & Exporting' started by the_motionblur, Oct 22, 2014.

  1. the_motionblur

    the_motionblur

    Joined:
    Mar 4, 2008
    Posts:
    1,774
    I have a strange problem with Maya LT. On some of the objects I've created in the scene I don't seem to be able to export the hard edges into FBX. OBJ works fine but FBX doesn't seem to work.

    I've created the model in modo and imported it into Maya LT. There I've set the smoothing angle of the object and manually edited a few more edges. In Maya it looks good but in FBX I don't seem to be able to export it and it's driving me nuts.

    If someone has an answer please also explain obvious things in Maya or the exporter. I'm rather new to Maya LT.

    Here is a screenshot comparison:


    Here are the files in case someone is willing to test it:
    https://dl.dropboxusercontent.com/u/63380367/ring_smoothing.zip

    Thanks a lot for any help. :)
     
  2. the_motionblur

    the_motionblur

    Joined:
    Mar 4, 2008
    Posts:
    1,774
    Update: It seems there's something severely broken in the mesh. If I create a model like this from within Maya and set the normals everything works absolutely fine. Damnit!

    Can soneone tell me what is wrong with the mesh or even how to fix it?
    I have a file with a lot of single meshes like this and the normals need to work in there. I can't recreate all the modeldata just for the normals. :(
     
  3. vidi

    vidi

    Joined:
    Oct 14, 2012
    Posts:
    175
    If I understand correctly you want the the fbx looks like the obj file in Unity?

    if so, decrease the smooting angle in the Unity model settings panel
    That's all .
     
  4. the_motionblur

    the_motionblur

    Joined:
    Mar 4, 2008
    Posts:
    1,774
    Hi Vidi.

    Thanks for the reply. The problem is that the smoothing on the edge isn't based on a smoothing angle alone (also I need to pass this forward to another customer of whom I don't know if they will want to have a specific angle in Unity). The model contains manually hardened edges that aren't possible by a fixed smoothing angle, otherwise.

    I've found a rather unconventional solution in the meantime, though. It seems that the normals imported in from another package are corrupted and somehow can't (or I just don't know how) be removed inside Maya.
    I've loaded everything into ZBrush and exported it from there since I know that ZBrush does not save anything else besides mesh data and UVs. That did the trick.

    If you do know a cleaner solution to this I'd be glad to hear it, though. :)
     
  5. vidi

    vidi

    Joined:
    Oct 14, 2012
    Posts:
    175
    if you import you fbx in Unity and use the Model Panel Normals calculate , it is a easy thing
    or trangulate your model, before your imported it into Unity
     
    Last edited: Oct 24, 2014
  6. the_motionblur

    the_motionblur

    Joined:
    Mar 4, 2008
    Posts:
    1,774
    This only works if you can use the same Phong-Edgebreaks across the whole model. As soon as you need to set hard edges manually this is not an option any more. I can't use normalmaps in this project so I need the edgebreaks.

    Have a look at the FBX file and see if you can find an angle that keeps all the bevels with hard edges but also has the inside of the screwholes in the mesh softened out. In some cases a mathematical edgebreak is unfortunately impossible. Even though it would save me some work if it was that simple. :)
     
  7. Thomas-Pasieka

    Thomas-Pasieka

    Moderator

    Joined:
    Sep 19, 2005
    Posts:
    2,174
    Make sure you set your FBX export settings properly. Smoothing, hardening of edges/polygons works fine for me. Here is a screenshot of two objects. One has hard edges and the other has softened and they exported and imported fine.



    And a shot of the objects imported into Unity. Looking the same...

     
  8. the_motionblur

    the_motionblur

    Joined:
    Mar 4, 2008
    Posts:
    1,774
    Hey Thomas. Thanks for your reply. :)

    I actually tried that but it seems that really the normals are somehow broken when imported into Maya. I tried the same thing you did with a model created in LT and it worked as expected. The imported model it seems won't let go of the messed up normals unless I export as OBJ without anything but the UVs.

    Somehow I haven't found any solution to make Maya forget about the normals. And I don't know what exactly is messed up, either, unfortunately.

    I mean ... sure the export(import hack is a solution but it's still problematic. I hate if I don't know what causes such a problem and even more so where I can see what it is or what causes it because it means that I can't fix it adequate if I need to or can't use my export/import workaround.
     
  9. Thomas-Pasieka

    Thomas-Pasieka

    Moderator

    Joined:
    Sep 19, 2005
    Posts:
    2,174
    What are you using to export the models from? C4D? It seems as that is the main issue here.
     
  10. the_motionblur

    the_motionblur

    Joined:
    Mar 4, 2008
    Posts:
    1,774
    Modo - Cinema comes with it's own export problems ;)
    I am pretty sure that modo is the culprit, here. Not even setting a normal angle works inside Maya with the meshes. If you read through what @Farfarer writes about modo and normal behaviour on The Foundry's forums all the time it seems likely, at least.
    Anyways it seems odd to me that there is no way to simply revert all the normal information in Maya back to a default.
     
  11. Thomas-Pasieka

    Thomas-Pasieka

    Moderator

    Joined:
    Sep 19, 2005
    Posts:
    2,174

    Ahh yes Modo does have it's issues with that. Edge/Poly smoothing/harden in Modo is a serious disaster. On top of that you have FBX issues at export likely due to buggy implementation of the FBX SDK. Seems as if Maya can't override it for whatever reason. In any case, since these are fairly simple models why not use Maya directly? Is there a reason that you switch between apps?
     
  12. vidi

    vidi

    Joined:
    Oct 14, 2012
    Posts:
    175
    Uh, I have not any such expensive Applications and I have
    not idea what is the actual problem
    maybe my lack of english,but if I do what I suggest in my post your fbx looks absolutely identical to your obj .

    Have you try what I wrote?

    if you import you fbx in Unity and use the Model Panel Normals calculate , it is a easy thing
    or trangulate your model, before your imported it into Unity
     
  13. the_motionblur

    the_motionblur

    Joined:
    Mar 4, 2008
    Posts:
    1,774
    Yes. I'm simply much faster with modo and it's more complex than the simple part shown here. I can't post the whole model(s), though.
     
  14. the_motionblur

    the_motionblur

    Joined:
    Mar 4, 2008
    Posts:
    1,774
    Vidi, I understand completely what you proposed but it is not that simple. I know it is possible to let Unity do the edge calculation but calculated edges alone do not suffice in this case. Edge calculation sets a fixed smoothing angle on the whole mesh. Now imagine I have a very tiny slight bevel that needs to have hard edges as well. If I set the smoothing angle for the whole mesh this very shallow bevel will just get smoothed over. Since it's a visualization for techical components I need everything to look crisp in the right places. That's why in this case unfortunately the smoothing angle alone won't cut it. It's also the reason I'm using Maya as the final step here, because I just know that the output from Maya works (also I want to learn it).
     
  15. Farfarer

    Farfarer

    Joined:
    Aug 17, 2010
    Posts:
    2,249
    So there's a couple of things with MODO > Unity.

    If you're using 701 SP3 or newer, then you want to UNTICK "Save smoothing groups" in your FBX options and TICK "Save mesh smoothness".

    Unity's FBX importer doesn't like having both of those and it falls over and just recalculates the normals itself.

    Aside from that... you shouldn't have any problems. I certainly haven't experienced any :/
     
    the_motionblur likes this.
  16. the_motionblur

    the_motionblur

    Joined:
    Mar 4, 2008
    Posts:
    1,774
    Hey - thanks, Farfarer. I will try that. This may be what causes the weird behaviour. Since 801 introduced the mesh normals I had been using the mesh smoothness and split edge normals, though. Somehow I never liked the smoothing group approach especially since it's a pretty easy thing in Maya.

    I should add that even Maya imported the models correctly at first but changing any edge angle destroys the smoothing groups. Does Modo treat smoothing groups and split vertex normals different, technically?
     
  17. Farfarer

    Farfarer

    Joined:
    Aug 17, 2010
    Posts:
    2,249
  18. the_motionblur

    the_motionblur

    Joined:
    Mar 4, 2008
    Posts:
    1,774
    Update: The modo exporter really seems to be doing something pretty funky to the mesh normals. An FBX file imported from Modo801 with mesh smoothness and split edge normals can crash Maya LT consitently by trying to lock the normals on the mesh. I've even had this confirmed by someone from Autodesk.

    So yeah - the phong material in the other thread can be solved inside maya but the fbx normals are behaving really strange. Since I don't know what actually causes this and if this may introduce unknown problems later I am going to use the obj export hack and do final exporting from Maya for the time being.

    So in case anybody encounters the same problem. This is probably going to be your solution.
    It's not happening all the time, though. I also could not pinpoint when the smoothing problem was introduced, exactly.
     
    Last edited: Oct 29, 2014
  19. Farfarer

    Farfarer

    Joined:
    Aug 17, 2010
    Posts:
    2,249
    So there are several "layers" for Modo's normals. If one isn't there, the next down is used.
    They follow as (top-down);
    Vertex Normal Map - This stores (potentially) one normal for each vertex of each polygon.
    Smoothing Groups - Does what you'd expect - smoothing groups a-la 3DSMax.
    Material Smoothing Angle - Hardens/softens edges depending on whether they're sharper than the angle defined in the material.

    That said, it all gets exported to FBX in the same way - whatever you see in the viewport is whatever gets exported. So it shouldn't cause any issues. I've certainly not had any issues going from Modo to 3DSMax/Unity/UE4/Handplane/xNormal via FBX. All of those read the vertex normals properly.

    But it will lock the normals in Maya, because FBX stores the normals as object-space vectors, so they're already "locked". I'm not sure why that would crash Maya... you should just be able to unlock the normals.

    Any reason you're going Modo > Maya > Unity, btw?

    EDIT: I loaded up the FBX file from your original zip file into Modo. All of the vertex normals are zero length as far as I can tell. Sounds like something from Maya's end that's the issue.
     
    the_motionblur likes this.
  20. the_motionblur

    the_motionblur

    Joined:
    Mar 4, 2008
    Posts:
    1,774
    Hey Farfarer,

    I can't say where the odd behaviour got intoroduced, either. Maybe the FBX got messed up at some place along the line and it's a problem I've only had with all of the models in this one file as there were several more originally. On other files I didn't encounter the problem any more, either.

    Thanks for the explanation on the layered hirarchy of modo's normal export. :)