Hi all!
Been pulling my hair out over this. For the game I'm working on, we need all the characters to have 3 material slots, in a particular order. Hair/skin, Upper Body, and Lower Body.
I can't seem to get them to load in any particular order, with any rhyme or reason. I'm assigning materials in Maya and exporting as an fbx.
I've tried assigning in the order I want, and renaming materials to alphabetically go in the right order, but that doesn't seem to do it.
In the documentation, it mentions appending skin0# to the materials (showing a max screenshot with the names as such), to set the order. So _skin00 _skin01 _skin02 et cetera. But this doesn't affect anything either, while exporting from Maya.
These are rigged meshes, so I can't mess with the meshes themselves. Any idea what I need to do to solve this?
Thanks!
Replies
I thought it might have to do with a mesh keeping its order once imported but made a mesh without _skin## assignments, imported it the material ids order were random, and then edited the mesh in Maya with the _skin## suffixes and reimported, with the order changing as expected.
Try exporting your fbx file as ascii, and making sure the materials are named what they should be in the actual exported file ie: with the _skin## appended (I used notepad++). Each material name shows up in 2 places for me in my simple file, that might be different for something rigged and skinned. I was able to rename _skin00 to _skin01 and vice versa and have that switch material order when I re-imported the file to UE4.
I also tried to re-order a file without the _skin## suffixes, to see if the material order changed, which didn't work, so the importer obviously uses something different to order the material ids than the order in which it parses them.
that said things like numbers and _ characters probably mess up where the importer is looking for key words like "skin##" so keeping it as simple as possible is probably best
I separated the mesh by its materials, so one material per mesh (each mat is a drawcall anyways). I have the meshes in the top hierarchy of my maya scene, and the order in which they are in the outliner is the order the materials are imported into UE4. Why this is, i dont know.
Maybe not enough peoples are having this problem, but its a pain when you have teammembers using Max. Epic should drop the archaic concept of material IDs, and implement a system, where materials are indexed by their names, instead of order.
Its still missing the the array and filtering but the order of the material coming from that iteration should be the same as in fbx export file?