x


Importing Models

This is a question I've just kind of avoided asking because things have worked but I've never really understood why, now my folders are FAR too messy and things are going wrong and right and I don't know why, so I figure I'll ask as unity doesn't really seem to have extensive documentation on the subject. When importing a model what EXACTLY happens, and what is required? Does it import the materials with the model, but then you have to import the textures for those materials seperately? Do the textures get imported automatically too? Do materials all get imported into one place? Will a material only reference a texture in the same folder as it? In short what do you need to do to import a fully textured model, and is it different with animations?

more ▼

asked Oct 01 '11 at 05:14 PM

ungalyant2 gravatar image

ungalyant2
159 18 22 29

(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

OK, a lot to be answered.

There are some changes that I've found in 3.4, but the official documentation can be found here.

In order to import a model in Unity you need to do several things:

  1. Your textures need to be imported in a "Textures" folder in your project in Unity. The Textures folder is something like the Resources folder. It is possible to have multiple folders with the same name of these folders and Unity will put all the files in these folders together so it creates some sort of pool. For objects (prefabs, materials, etc) that you want to instantiate through code, you need to have these objects in a Resources folder. For an automatic texture-material match for the models you want to import, you need to put your textures in a Textures folder.
  2. Your model needs to be somewhere in the Unity project (inside your main Assets folder) that you can locate it easily. Unity will then import all your materials and put them in a "Materials" folder next to the imported model. All the materials that have a texture that is inside a Unity "Textures" folder will be named as the texture and will be linked to that texture.
  3. Unity will generate a prefab that includes your imported model. Depending on what type of compression/file (Maya, MAX, FBX, Blender, etc) you can set several import settings, like if you want to generate colliders for your model, or how to import your animations attached to the imported model.

What we usually do for our modelling pipeline, is to create a folder for the specific model in one Assets/Resources folder (this is done in explorer, without Unity open). This folder is named appropriately so that we can find it easily. In this folder, we create a Textures folder and put all the textures there. Then we place our FBX model also in main folder of the model. When starting Unity, it loads in all textures and then the model, creating the Materials folder and the prefab in the designated folder. This way we have all information of one model in one place.

Hopes this helps! :)

more ▼

answered Oct 01 '11 at 05:42 PM

Martijn Hendriks gravatar image

Martijn Hendriks
101 3 4 9

(comments are locked)
10|3000 characters needed characters left

Also, a lot of the time, the image may not be imported on certain objects occasionally due to a glitch or error. Either way this is easily bypassed by locating the TEXMAP Image (a psd map of the painted image on the model which alot of modeling programs allow you to export separately usually) and dragging and dropping it into the " Materials " folder that was created when your model was imported into unity. You can then click on defaultMAT located in that folder, select your TEXMAP Image and apply it, it will then be applied appropriate to the UV Map within unity and added to your Model. Now your Model will have the texture you originally created for it and you will be able to visually see it in unity as well.

more ▼

answered Jul 12 '12 at 04:49 AM

Deygus gravatar image

Deygus
38

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x406
x281
x184
x141

asked: Oct 01 '11 at 05:14 PM

Seen: 2829 times

Last Updated: Jul 12 '12 at 04:49 AM