I've posted this on the forum quite a while ago and forgot about it - but as the posting got bumped I thought it's worth a quick q/a over here:
When importing objects, there's materials created automatically which sometimes (e.g. in the case of having lo-poly/hi-poly models) isn't that useful, in particular when you work with modified copies of those models.
So, is it possible - and if so, how - to disable automatic generation of materials?
RTFM ;-) Well, in the current version of Unity (2.6), you find a DropDown in the FBXImporter-section under "Materials" which says either "Off", or "Per Texture" or "Per Material". So that does the trick. Maybe someone could add if there's a way to make this the default (my guess would be that this is possible with editor scripting but there might be an easier way, too).
In this property inspector, you can also disable importing animations.
EDIT: There's also an example of how to disable this always via editor scripting in the scripting reference: AssetPostprocessor.OnPreprocessModel
In C#, this would look something like:
using UnityEditor;
public class MyMeshPostprocessor : AssetPostprocessor {
public void OnPreprocessModel() {
// Disable generation of materials if the file contains
// the @ sign marking it as an animation.
if (base.assetPath.Contains("@")) {
ModelImporter modelImporter = (ModelImporter) base.assetImporter;
modelImporter.generateMaterials = ModelImporterGenerateMaterials.None;
}
}
}
Only problem with this approach: I think it would probably set this to "none" each time the model is reimported which would overwrite manual changes. Anyone has an idea how that could be solved (in an easy manner without having to do our own book-keeping ;-) )?