Search Unity

UV Maps - Blender to Unity Model - Problem !!!

Discussion in 'Asset Importing & Exporting' started by wilk1, Jun 9, 2017.

?

UV Maps - Blender to Unity Model - Problem !!!

  1. Problem with Unity

    30 vote(s)
    93.8%
  2. Problem with Blender

    2 vote(s)
    6.3%
  1. wilk1

    wilk1

    Joined:
    Apr 8, 2017
    Posts:
    13
    Hey, I don't speak English very well, but I try. My model have one mesh with many materials. When I export my fbx model from Blender to Unity, Engine igonre my UV Maps. Unity can see my textures but mapping is bad. I set mapping in texture options in Blender. What I did wrong ?
     
  2. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    image?
     
  3. wilk1

    wilk1

    Joined:
    Apr 8, 2017
    Posts:
    13
    What do you mean ? In Blender everything is ok but in Unity textures are bad impose.
     
    Last edited: Jun 9, 2017
  4. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    Show an image of the problem :p
     
  5. wilk1

    wilk1

    Joined:
    Apr 8, 2017
    Posts:
    13
    ok :). I have 2 UV map in one model (Picture nr.1), I also set Uv in texture setting. But in Unity i can't see this UV name in standard material (Picture 2). Unity set first uv map for everything textures.
     

    Attached Files:

  6. wilk1

    wilk1

    Joined:
    Apr 8, 2017
    Posts:
    13
    UP. No one knows how to solve this problem.
     
  7. daxiongmao

    daxiongmao

    Joined:
    Feb 2, 2016
    Posts:
    412
    First thing is to check the model in unity. I think if you click on the fbx file or the mesh inside there unity will tell you the vert and face count plus what other vertex attributes it has. Uv0, uv1 etc.
    If you don't see two uv sets that is your problem.

    I haven't used the newer standard shaders that much but your picture doesn't show the full inspector.
    I see the first material has a setting for uv set to uv0 but I don't know if that is for the secondary maps option only.
    I kind of think it might be.

    Most shaders assume your diffuse is on uv0 and even if you have two materials both will use uv0 and they are just applied too different faces. While uv1 is used for light maps usually and requires different shaders.

    I am not sure why you would need two uv sets one for each part of the mesh. Both should use the same uv0.
    Unless you are trying to do some texture mixing.

    If it's a workflow thing. You may need to flatten your uvs before exporting or write a special shader.

    Maybe someone who has used the newer standard shader can give more info on its uv assignments.
     
  8. Cygon4

    Cygon4

    Joined:
    Sep 17, 2012
    Posts:
    382
    A few things to try:

    1 - Make sure what you see in the Blender viewport is actually your UV map (Coordinates must be set to "UV" and Map must name your UV map)

    blender-uv-setting.png

    2 - The default behavior in Unity is:

    1st UV map is used for textures.
    2nd UV map is used for lightmaps.

    Try selecting your other UV map in the Unity material (under UV Set)

    unity-uvset.png

    If that also doesn't help, backup your .blend file, remove the second UV map and try again.
     
    sorcerboo likes this.
  9. wilk1

    wilk1

    Joined:
    Apr 8, 2017
    Posts:
    13
    @daxiongmao @Cygon4 Thank you for help.I thing problem is different. I set mapping in blender in texture setting.
    Why am i need 2 mapping in one mesh ? The reason is: i have character with eyes and hair. I have different textures for hair, eyes, itp. I have to join it, becouse when I add animation hairs and eyes don't move together with main model. So I have one model (whole character) with 3 mapping (skin, hair, eyes).

    Maybe is simpler solution to do animation with model, when i have few textures. Can you give me some guide ?
     
  10. Cygon4

    Cygon4

    Joined:
    Sep 17, 2012
    Posts:
    382
    In that case, a single UV map is enough. You can assign a different material to each face (polygon).

    Animation is done via bones -- even if eyes and face have the same material + texture, they can move independently.
     
  11. Rs

    Rs

    Joined:
    Aug 14, 2012
    Posts:
    74
    I figured it'd be nice to add an up to date trick tested in Unity 2019.

    Unity imports the FIRST UVMap in order from the Blender list as UV0. If your UVMaps in Blender are in the wrong order (so the 2nd one is the one you want to import as UV0) when importing, tick Swap UVs. See below.
    This obviously will work only when your UVMap is the second in the list in Blender or your 3D software.
    I'm not sure since when Unity has this feature.

    I wish there was a list to select from when you import so I can decide which one is the UV map to use as UV0 in Unity. Feature request maybe?

     
    Last edited: Mar 2, 2020
    Cloud-Painter and JDCezaro like this.
  12. grobonom

    grobonom

    Joined:
    Jun 23, 2018
    Posts:
    335
    yes. @Vygon4 is right.
    Only 1 UV is needed as you can assign mutiple material on an object in blender.

    In unity standard shader, this UV is usually UV0

    The second UV layer you've created in blender will stick to the lightmap layer in unity with a big probability to mess up.
    If you want to use a 2nd UV layer in blender, you have to disable baked & realtime GI in unity or dive in the unity UV layer mess in shaders :/