FBX Material Main Color Problem

I have a .fbx building model which contains 461 textures,each texture mapping a material. It looks nice in the 3D MAX 2009.
However, when the unity 3d rendering it,most materials’ main color turn yellow,few of them turn red or black.As a result, the model become a golden building,you can imagine that :frowning: .
I can turn them back to white, but there are more than 400 materials in only one models, and I have decades of these kind of models.It is a nightmare to modify them all manually.

Please tell me how to solve this problem.Is there any method to modify them automatically?[/img][/code]

How to batch modify the materials’ main color of a fbx model

Yeah that’s the fastest way I think: just change the colour of materials in Max before export.

Another maybe quicker way is to use a script that you can find in the Unity Wiki that allows to make mass change modifications to materials: you select the materials you want to change and select what changes you want to do, once, for all selected.


Hi,you guy.Thank you for your hint,I find the solution finally,by changing the code of the Unity 3D Wiki,like the following:

@MenuItem("Scripts/Mass Set Materials")
static function MassSetMaterials() {
    Undo.RegisterSceneUndo("Mass Set Materials");

	for(var mat:Material in Selection.activeGameObject.renderer.sharedMaterials){
		mat.SetColor("_Color",Color.white);
	}
}

Do as the folloing:
1.Create a js script, named MassSetMaterial.js, in the Editor folder;
2.Select a model in the Hierarchy view;
3.Click Scripts > Mass Set Materials from the menu bar at the top of the scene.

Ok, enjoy it,:-)!

1 Like