Applying materials/textures on imported fbx, dae, etc

Thank you in advance for any help!

I’ve been learning how to use some 3d modeling tools like blender and sketchup so as to improve the complexity of objects in my game but have run into a problem that I can’t seem to find a solution for here in the forum/answers or anywhere else.

Here’s my problem:

  1. I create a cube in Blender.

  2. I export the cube as an fbx file (I’ve also tried all the other formats including dae)

  3. I import the fbx file into my unity project/scene

  4. I try to add a texture to one of the materials associated with the cube

  5. Nothing happens

If I change the “Main Color” of the material, the cube’s color does change. But I can’t seem to figure out why I can’t see the added texture… I run into the same problem even when I create a new material & texture and apply it to the cube. Color works, but no texture is visible?

Am I just doing something wrong, or is there something that I’m missing/not understanding.

Any help would be much appreciated, thank you!

Not being a modeler, i have almost no experience with the tools themselves, but does blenders cube primitive come with UV coordinates already set? and are those coordinates being exported with the fbx?

That would be my first question when dealing with a non-displaying texture. Here is a small C# script that you can attach to any object with a mesh filter. Drop this script on it and run, you should get the uv coordinates for the object. At least one of the channels (preferably the 1st channel unless you’re using a shader that will look in the other channels) should have your uv coordinates. If there are no coordinates being output, then the cube was either never mapped, or material coordinates aren’t being exported with the fbx.

public class UvConfirm : MonoBehaviour
{
	void Awake () 
    {
        MeshFilter meshRend = GetComponent<MeshFilter>();
        if (meshRend != null)
        {
            LogUVs(meshRend.sharedMesh.uv, 0);
            LogUVs(meshRend.sharedMesh.uv1, 1);
            LogUVs(meshRend.sharedMesh.uv2, 2);
        }
	}

    private void LogUVs(Vector2[] uvs, int channel)
    {
        string output = "ArrayData: (";
        for (int i = 0; i < uvs.Length; i++)
        {
            output += uvs*.ToString();*

if (i < uvs.Length - 1) output += ", ";
}
output += “)”;
Debug.Log("UV Channel " + channel.ToString() + ": " + output);
}
}

FatWednesday, thank you again.

The solution, after utilizing your script to reveal the lack of UV information, was to return to Sketchup and simply added a texture to my model. I then, the same as before, exported it and imported it to Unity.

Now, I am able to successfully add textures directly in unity!