FBX-Import Bug - Skeletal Meshes keep reference to unused material IDs

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:

  1. 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)
  2. Export the mesh with animation and Import into Unreal as a Skeletal Mesh
  3. As the cube uses 2 Material IDs, the skeletal mesh editor shows 2 materials used.

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

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

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

For completeness: Importing that same cube as a staticMesh does not reveal any such behaviour. The cube as 2 Material Slots when opened in the StaticMesh Editor and when dropped in a scene/BP. Thus it seems like the skeletal mesh import is failing at condensing MaterialIDs

Hey LeFxGuy,

Thanks again for the separate post and all the details. This has been submitted and can be tracked here: Unreal Engine Issues and Bug Tracker (UE-35673)

Tim