Search Unity

Can't Calculate Tangents Because Mesh Doesn't Contain Normals?

Discussion in 'Animation' started by n3sto, Sep 19, 2019.

  1. n3sto

    n3sto

    Joined:
    Apr 16, 2019
    Posts:
    8
    I just finished rigging my character from scratch in blender 2.8.75 and imported it into Unity and I get the following message:

    Can't calculate tangents because mesh "w.head.touch" doesn't contain normals.

    This error is relating to all 76 of my touch bones in my blender character. I applied the location, rotation, and scale in blender, but I don't know why I'm getting this particular error when I import it into Unity. After I finished with the bones on my Blender character and imported it into Unity, everything worked up until that point. But now that all the bones and rigging and everything is all finished, I get this error. Is there something I need to do with my bone shapes to correct this? Any help would be greatly appreciated.

    Screen Shot 2019-09-19 at 6.58.36 AM.png
     
  2. ModLunar

    ModLunar

    Joined:
    Oct 16, 2016
    Posts:
    374
    I use Blender as well, so I may be able to help! I'm wondering though: what format did you export as, was it an .fbx file? And did your export only contain an armature/bones, or did it also include actual Mesh(es)?
     
    Lancelot7 likes this.
  3. n3sto

    n3sto

    Joined:
    Apr 16, 2019
    Posts:
    8
    Hello!

    I exported my character as a blend file and it included both the mesh and the armature. Is it better to try to import it as an fbx to see what happens?
     
    Last edited: Sep 20, 2019
  4. ModLunar

    ModLunar

    Joined:
    Oct 16, 2016
    Posts:
    374
    Ohh hmm I've only tried directly using .blend files in my Unity project once or twice -- it lagged a lot because I think Unity actually calls the Blender program, opens it, and exports it behind the scenes to interpret the .blend file somehow. Though that's just extra info,

    Yeah definitely try exporting as an FBX! If you're having trouble, I can take a screenshot of the settings I use to export correctly -- I have one set of FBX export settings for non-rigged Meshes without animations, and another set of FBX export settings for rigged Meshes with animations. (Certain settings may completely omit animation, or other data from the export!)
     
    n3sto likes this.
  5. n3sto

    n3sto

    Joined:
    Apr 16, 2019
    Posts:
    8
    Tried importing as an FBX and the same errors exist. It still says, "Can't calculate tangents because mesh doesn't contain normals." I want to also mention the way I created these specific bone shapes that are causing these errors. All of these 78 errors are technically considered separate meshes in Blender. In Blender, for each one, I pressed shift A, add mesh, construct a circle mesh. So the 78 circle meshes are the ones causing the errors. The errors are not actually talking about the characters' mesh itself which is called "figure." Not sure if this has to do with anything, but thought I say something just in case it does.

    It would be awesome if you could upload your FBX settings! I have no idea what settings to use and I just used the default settings. My character has no animations yet. I'm planning on using the Unity motion capture data humanoid option. It only has a full rig, the complete armature, and a complete mesh. Thanks in advance! FBX Unity Errors 9-20-19.png
     
    Last edited: Sep 20, 2019
  6. ModLunar

    ModLunar

    Joined:
    Oct 16, 2016
    Posts:
    374
    @n3sto Here are the settings I use. First, make sure you go under File > Export > FBX (.fbx). These screenshots are from Blender 2.80:

    upload_2019-9-21_15-39-15.png


    I have two presets, one for "Meshonly" (non-rigged objects that do not have animation) and another called "Skinnedmesh" (rigged objects including armatures and meshes, that also may have animation).

    Here are my settings for "Meshonly":

    upload_2019-9-21_15-59-44.png

    And for "Skinnedmesh":

    upload_2019-9-21_16-0-3.png

    Some things to note:

    - Under the "Main" tab, I turned ON "Selected Objects", so only your selection will be exported. This may be important, if your mesh accidentally wasn't exported parts of it! What I do is select the top-most root object (in Object Mode) in your hierarchy, use Shift + G to select all children (which DOESN'T include the root of the hierarchy), and then re-add the root of the hierarchy to your selection by Shift + Clicking its little icon in the Outliner/hierarchy:

    upload_2019-9-21_16-34-41.png

    - Under the "Main" tab, I turned OFF the button to the right of "Scale: 1.00". The tooltip calls it "Apply Unit." I've found by turning this off, the FBX will export into Unity with a nice scale of 1, with no weird 0.01 or 100 values anywhere. With that button off, and "Apply Scale" (just below that setting) set to FBX All Every unit you model in Blender is exactly one unit in the resulting FBX in Unity.

    - Under the "Main" tab, the forward and up values didn't seem to do anything, but I still set them to Z forward and Y up as we use in Unity, just to be safe.

    - Under the "Geometries" tab, I turned ON Tangent Space, so Blender will attempt to calculate tangent space and export it with the model. This does require good mesh topology to a degree (triangles and quads only, N-gons where N is 5 or greater may cause your export to fail. If you need to find N-gons quickly, consider using "Select Faces by Sides" in Blender so you can locate all the sources of error)

    - Under the "Armatures" tab, I turned ON "Only Deform Bones" so that you can mark certain bones to NOT be exported, if they are only used for bone constraints like IK (Inverse Kinematics), Track To, etc..

    - Under the "Armatures" tab, I set the primary bone axes so that in Unity, bones will use +Z as their forward axis, and +Y as their "up" (secondary) axis. The values just happened to be Z and -X. Another great setting to have for convenience/neatness of your models ;). The negative in -X for the secondary axis setting seems to help the space to go from Blender's right-handedness to Unity's left-handed coordinate system, by flipping the left-right (X) axis.

    - Under the "Animation" tab, you can turn ON "Baked Animation" if you'd like to export animation of any kind. For "Meshonly", it's off, but you can just turn it on if you wanted a non-rigged model to export with animation it has on its object.

    - Under the "Animation" tab, I turned off "All Actions". It's been off for a long time, but I think I did that either to stop Blender from exporting the entire animation timeline, or the names were like "Armature|Idle", "Armature|Jog" for my "Idle" and "Jog" animations. Instead, I rely on the "NLA Strips", which are like animation clips, but in Blender! You can see them in the NLA Editor window. These strips will export directly to AnimationClips in Unity, so your animations are already separated, and will be named appropriately as "Idle", "Jog", etc.
     

    Attached Files:

    Last edited: Sep 21, 2019
  7. n3sto

    n3sto

    Joined:
    Apr 16, 2019
    Posts:
    8

    This worked! No more errors when I upload and all the Unity motion capture data is working perfectly on my character. Thank you so much for your help, you guys are awesome!
     
    ModLunar likes this.
  8. izkkhan16716

    izkkhan16716

    Joined:
    May 17, 2020
    Posts:
    1
    I


    Is that error becoz of that settings to save from blender
     
    n3sto likes this.
  9. n3sto

    n3sto

    Joined:
    Apr 16, 2019
    Posts:
    8
    Yup that's it
     
  10. esmedgipsy

    esmedgipsy

    Joined:
    Dec 22, 2021
    Posts:
    1
    Hello, I'm also trying to solve the same error in unity "
    Can't Calculate Tangents Because Mesh Doesn't Contain Normals
    but another error came out when trying to export my FBX following your export settings.
    "tangent space computation an uv map not found aborting" can someone help me please.
     

    Attached Files: