Hi PC,
The animator I've been working with asked me about material workflow today - I feel like this is such a basic question on the one hand, but I'm not sure how to elegantly answer it for her.
"...there are a bunch of extra materials associated with my animation files that get imported every time I bring in a new animation. Is there a way to map the unity material to the models in Maya to avoid importing all these extra
files?"
Everyone has game engine blind spots, and I think this is mine!
Replies
Sounds like every time she imports an animation it has mesh data in so new materials are being created.
On selecting the asset in the project view there is a tick box for "import materials" that appears in the inspector, you will probably find the solution there. Having said that, it will generate the materials the first time you import the asset before you have a chance to change the default settings.
I think its possible to have a script to do it automatically based on folder or name (kind of like this http://forum.unity3d.com/threads/can-i-change-the-default-import-settings.50043/ ) but I'm not sure how sorry, maybe one of your programmers could make it work.
create a new .js file and place this in a folder at the root of your project called "Editor"
class CustomImportSettings extends AssetPostprocessor {
function OnPreprocessModel() {
var importer : ModelImporter = assetImporter as ModelImporter;
importer.materialName = ModelImporterMaterialName.BasedOnMaterialName;
}
}