As I indicated in the repro steps, we have a StaticMesh asset that, for some reason, has a mismatch in its serialized bulk data where:
- MeshDescription->GetNumUVElementChannels() == 2
- FStaticMeshConstAttributes(MeshDescription).GetVertexInstanceUVs().GetNumChannels() == 1
When exporting to FBX with bExportSourceMesh = true, in FFbxExporter::ExportStaticMeshFromMeshDescription:
- TexCoordSourceCount = 2, so the loop that creates UV layer runs with TexCoordSourceIndex = 1
- It calls VertexInstanceUVs.Get(VertexInstanceID, TexCoordSourceIndex)
- As VertexInstanceUVs has only one channel, it crashes.
Have you seen this on your end? Should the call to MeshDescription->GetNumUVElementChannels() be changed to VertexInstanceUVs.GetNumChannels() instead?
(cc: Alexis Matte)
[Attachment Removed]