So, how do we know which of our materials in Blender or another modeling program will be assigned to which SL Object FACE? We have an answer and tutorial… sort of.
First, remember that objects in Second Life™ have a FACE. Face in SL use has a different meaning than it does in Blender or other modeling programs. In SL an object has 1 to 9 ‘faces’ regardless of how many polygons there are. SL Faces are groups of polygons. We can assign a texture/material to each of those SL faces.
But predicting which material in Blender would be assigned to which SL Face has been a changing problem and recent changes to the viewer have changed it again. When we built a mesh in Blender the order in which we made materials in blender determined the order in which materials were assigned to the SL Faces, 0 to 8. No longer.
There is a thread in the SL Forum where the subject is being discussed: Face numbers – How to predict their order? (Assigning materials in Maya 2012). The answer for both Maya and Blender are to be found in the thread. These answers give clues to how the problem can be handled in any modeling program.
According to Drongle McMahon, the basic idea is the Blender material assigned to Face #0 is the alphabetically sorted first material name, so a material named AAA would be ahead of one named AAB. For Face #1 (AAB-material), the next material in the sorted order and so on. So, in Blender material names are the controlling factor.
One has to look in the exported Collada file to see how their modeling program is naming materials in the exported file. It is the names in the file that the Linden up loader sorts.
This assignment ordering was changed to a alphabetically sorted list of names when material matching across LODs was changed to work better by depending on material names. The first in alphabetical order is assigned to SL Face 0, the next to face 1, etc. In Blender, this means that the order of materials in the material list no longer determines the face numbers. (Reference)
In Maya 8.0 it is a bit more complicated. Cathy Foil explains:
In Maya 8.0 using the Open Collada plug-in alphabetical order of the material names doesn’t matter.
It still matters the order in which the materials are combined but instead of first to last it is now last to first.
Step 1: Separate your mesh into individual objects so each material is its own object. Delete History of each object.
Step 2: Select the object you want to be the last face in SL and shift select the object you want to be the next to last and combine the two and VERY IMPORTANT merge the verteices. Example if your mesh has 4 materials and will be 4 faces in SL you pick the object you want to be Face 3 first then shift select the object you want to be Face 2. Remember Face 0 is the first face in SL so a mesh that has 4 faces will be named Face 0, Face 1, Face 2 and Face 3. So Face 3 is the last face in SL.
Step 3: With the object you just combined and merged shift select the object you want to be next lowest. In this case it would be for Face 1. Combine and Merge.
Step 4: With the object you just combined and merged shift select the last object which you want to be Face 0 and combine and merge. I normally Delete History at this point. You are now ready to export your DAE file. NOTE: When merging vertices a hard edge is formed so if you want soft edges you will need to soften them before you export your DAE file.
I have only tested this with the Open Collada plug-in and my version of Maya so I can’t say for sure it will work for all Maya users.
If you go over 9 materials in a model or file in your modeling program you may run into problems. As the thread progresses Cathy and Drongle get into the details of how Maya creates material names. Here Drongle provides a way to easily edit the Maya DEA export file to handle more than 9 materials and control the order in which they are assigned to faces.
As you read through the forum thread you find that third party viewers are writing the Collada file differently, which affect with material gets assigned to which SL Face. At the time the thread was being written (2015/10m/12d) Singularity was using an older style up loader and producing a different order for which materials are assigned to which faces.
Drongle’s thinking, backed by testing, that material names control the order applies to the Linden SL Viewer, post Oct. 10, 2015. You’ll have to test to see what works with programs other than Blender and Maya.