Problem with fbx model having two materials and the same texture

I have a ton of models that have two materials, but they share the same texture. (one material is opaque, and the other has alpha and needs a different shader).

When imported, Unity will generate two material slots on the renderer, but assign the same material to both slots. The “materials” array on the Mesh Renderer is read-only. I cannot manually assign materials, or create new ones. And I cannot assign an alpha shader to the second material, since it’s just a reference to the first material.

Does anyone know a way around this? I can turn material generation off, but then I get two references to “default diffuse” and can’t change them. It doesn’t matter if I tell unity to generate materials by material or by texture, both ways get the same result - one material generated, and assigned to both slots.

Followup: I wrote a max script that would go in and assign unique material names to the subobject Materials. The fbx importer would then generate three materials at import time, but at least it would assign two different materials in the material slots. Problem is solved, though I now have to re-export several hundred models.

You can manually assign materials to mesh slots in prefab. Anaway using prefab is almost must, so no problem.

Yeah, that was my first thought too, but it didn’t work with the system that I wrote for piecing skeletal meshes together. Probably need to go in and figure that out.