Search Unity

textures on imported meshes of blender

Discussion in 'Asset Importing & Exporting' started by dejjan_sp, Jan 20, 2017.

  1. dejjan_sp

    dejjan_sp

    Joined:
    Jan 18, 2017
    Posts:
    3
    Hi! , I have a problem importing objects from Blender, do not apply the textures (

    cube.jpg


    Both cubes have the same material, the left is a cube created in unity (gameobject -> 3D object-> cube) the right is a cube created in blender and imported.


    Why is there no texture (or maybe it is incorrect) in the right cube?
     
  2. kburkhart84

    kburkhart84

    Joined:
    Apr 28, 2012
    Posts:
    910
    Have you applied the material in Unity? And is the texture imported into Unity and applied to the material? Can you show us the inspector view of the object?

    Note that materials etc... generally don't get imported from external modellers. You might get lucky and get a color or something but don't count on it. This is a good thing actually because the shaders in Unity are totally seperate from the materials in Blender.

    ***

    Also, have you UV mapped the Cube in Blender? I think that is the problem. The cubes in Unity come with UVs, but the one you make in Blender needs you to UV it(or you could have Unity do automatic UVs).
     
  3. aer0ace

    aer0ace

    Joined:
    May 11, 2012
    Posts:
    1,513
    For me, Unity automatically creates a material for a material imported from Blender. The case with textures is usually one of the following:
    1. Make sure you've copied the texture into the Assets folder somewhere.
    2. Make sure the path in the Unity material is pointing to that texture. This would also be carried over from the Blender material, so ideally, the texture you are pointing to is already in the Assets folder when you are referencing it in Blender.

    This is how I do it, but it requires that you build some infrastructure:
    1. Art textures are separate from the textures in the Unity Assets directory
    2. My art folder structure matches the Unity Assets folder structure, specifically to a "Resources" folder, so that I can dynamically load them.
    3. I have scripts to copy the textures from my art "branch" to my Unity Assets "branch"
    4. In Blender, the path to the texture is relative to the blend file. This way, when the blend file gets exported/imported to Unity, the relative path remains the same to the texture file.
     
  4. dejjan_sp

    dejjan_sp

    Joined:
    Jan 18, 2017
    Posts:
    3
    I only import the mesh from blender ,next in Unity I create new material with textures and I apply it

    save2.jpg save3.jpg save1.jpg


    How can I make automatic UVs? i don't know...
     
  5. kburkhart84

    kburkhart84

    Joined:
    Apr 28, 2012
    Posts:
    910
    My recommendation is to learn UV mapping in Blender. Unity can do automatic UVs, but it takes another asset I've seen from the store(not internal to Unity). A cube is a great starting point to learning UVs, marking seams, etc... though with a cube you could easily do an automatic UV map in Blender without having to mess with seam marking. In any case, UV mapping is very important if you plan on doing any of your own modelling, so I highly recommend you learn about it.
     
  6. Ryeath

    Ryeath

    Joined:
    Dec 4, 2016
    Posts:
    265
  7. dejjan_sp

    dejjan_sp

    Joined:
    Jan 18, 2017
    Posts:
    3
    Thanks , with UV mapping in Blender works perfect when exported/imported to Unity .