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.

more ▼

asked Jun 15, 2012 at 07:39 PM

avatar image

2 1 2 4

For females, skin is more important ;-P

(sorry, couldn't resist...)

Jun 15, 2012 at 08:59 PM Wolfram
(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

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

more ▼

answered Jun 15, 2012 at 09:24 PM

avatar image

1.2k 88 82 117

Thank you for your response! After knowing this I continued research and found this similar post: http://forum.unity3d.com/threads/27738-Multi-Material-ID. Apparently 3DS Max has a way to assign face id's (found here: http://www.maxbasics.com/materials-tutorials/concepts/multi-material) and Maya handles materials and faces in a different way, where I cannot access face id info to change it. If anyone knows a way in Maya please let me know!

At this point it is just worth it to fix it in code in Unity rather than dealing with 3DS Max.

I really hope Unity finds a way to control face id's since this is crucial in my workflow as an artist. I shouldn't have to rely on programing for simple texture application.

Jun 16, 2012 at 01:10 AM rwenks
(comments are locked)
10|3000 characters needed characters left

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".

more ▼

answered Dec 06, 2012 at 03:55 AM

avatar image

1 1

This is perfect! That did it alright. Thanks for the answer.

Feb 13, 2013 at 12:36 AM SpaceJames

No problem. I'm glad to help. )

May 30, 2013 at 06:51 PM motodream
(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



Answers and Comments



asked: Jun 15, 2012 at 07:39 PM

Seen: 3494 times

Last Updated: May 30, 2013 at 07:29 PM