How to control material element order?

I model and texture in Maya, export as .fbx, and bring into Unity. I usually apply materials by faces. In Unity I need certain materials to be certain elements for my code. Is there a way of controling the element order in Unity without having to create another script?

Example: I have a female character and a male character. I have an eye material and a skin material. Each character is a combined mesh so I apply the materials by selecting eye faces and appling eye material and then selecting the skin faces and apply the skin material. When I bring them into Unity however, the Male eye material is applied to element 1 but the female eye material is applied to element 2 (and vice versa for the skin). This is not due to which material was created first in Maya, it’s not due to alphabetical order, and it’s not due to which material was applied first. I don’t know what could be causing this.

Uncombine meshes in Maya, then combine meshes which must share the same material, and assign the material to combined mesh, then recombine the meshes how do you like. The element order should be normal.

You also can see, are you in the right dirrection or no, just looking at the material order in the Maya’s “Attribute Editor”.

I just solved this myself in Maya.
I did it by separating out the mesh by materials… ie object A has been split up into A1 which has only material 1 and A2 which has only material 2.

Then, depending on the order I select A1/A2 when i recombine them: the exported mesh will have the material id’s accordingly.

This is due to to the id sequence of faces. The material of lowest id faces gets assigned to element0 and so on