I think I found a bug when Importing Skeletal meshes as they keep a reference to unused materials.
This is not 4.13 only and at least also valid for 4.12 and 4.11 as well
Steps to reproduce:
- Create A cube in 3dsMax, animated along an axis from frame 0-100, give it Material ID 1 except for one face, give it ID3 in 3dsMax. Create a Multi-Sub-Material with X materials (where X is is larger than 3, in my case 5)
- Export the mesh with animation and Import into Unreal as a Skeletal Mesh
- As the cube uses 2 Material IDs, the skeletal mesh editor shows 2 materials used.
- Drop the same SkeletalMesh animated cube into the scene or any BP. The Details Panel shows all the material IDs that the 3dsMax Multi-Sub material had
- Now, the problem is that the MaterialIDs shown in the DetailsPanel are also the ones that are used internally. In my case, I created a Texture Parameter with a Green Texture and a BP. Obviously you would want to reference the MatID shown in the skeletalMesh Editor but that does not work. You have to use the ID shown in the Details Panel.
- To verfiy draw calls, i created a second cube with a “condensed” multisub-material, dropped it into an empty level with only the cube and a point light and at least they both have the same number of draw calls! So the rendering system is unaffected but the internals are still messed up. I can also understand that all materials from the MultiSub Material are imported and I am fine with that but it should not keep MaterialID Slots/References to unused materials.
In our project cases, we had meshes with 400+ Slots! Just to give you an idea what mess there seems to be although I can’t savely reproduce this with a newly created asset nor make the asset public and I hope this small demo case shows the bug and is reproducible for you.