The proper way to texture models

Hi all,

I’m not sure if this is the appropriate place to ask this question. I have a 3d model and a texture I want it to use within Unity. When texturing the object, should I texture it in my 3d modeling app (right now, Blender) and export, or should I export, and import both model and texture as Assets in Unity and then assign the texture within Unity? When using this second approach, the texture appears small and tiled on the object. (Note: the imported object appears very small and needs to be scaled to be visible). I am exporting as .dae. Thanks for any info!

You should texture your model in Blender then export it, or just drop the .blend file into your project hierarchy. The process of texturing a model in blender is called UV mapping and you will probably need to do some tutorials on the subject if you have not done this before. The gist of it though, is:

  • Create a Material for your object with the texture(s) you wish to use, along with any other base material settings.
  • Assign this material to your object.
  • Enter edit mode for this object (TAB by default)
  • Select all the parts of the object you wish to unwrap and use the Unwrap button under UV Mapping in the Tools panel.
  • If the object is really simple you can maybe get away with a simple Smart Unwrap, but it is usually better to Mark Seams for all the seams you want to make, then use the plain Unwrap button.
  • Select the UV Editing Layout from the top toolbar ( it probably says Default by this field)
  • Select the image you want to UV map to from the bottom toolbar.
  • Now move your vertices to where they belong on the texture.

There is a bit of an art to UV mapping so don’t get frustrated at first, but do find some of the excellent tutorials all over the net and those should give you a good start. But UV coordinates are exported with the model so if you haven’t mapped them out, I’m not sure Unity would create a default set or not. A default set probably wouldn’t give you what you need anyway :slight_smile:

Hope that helps.

As for the object being imported too small, it’s because all objects in Unity seem to be imported at .01 scale from the file. If you want your object to come in at the scale you made them you can use this script:

using UnityEngine;
using UnityEditor;

class MeshPostprocessor : AssetPostprocessor {

void OnPreprocessModel () {
(assetImporter as ModelImporter).globalScale = 1.0f;
}

}

Placed in Assets/Editor ( Create the Editor folder if it does not exist ) to bring them in unmolested.

Thanks!

I’ve heard of UV mapping, but haven’t really looked into it. I’ll look for some tutorials on it. And thx for the script as well, it will definitely come in handy!