Setting the material of a UStaticMesh built from Mesh Descriptions at runtime

This is the correct answer, but GetSectionInfoMap() is only work on editor.
So i set section’s materialIndex directly

FStaticMeshLODResourcesArray& LODResources = StaticMesh->GetRenderData()->LODResources;
if (LODResources.Num() > 0)
{
	FStaticMeshSectionArray& Sections = LODResources[0].Sections;
	if (Sections.Num() > 0)
	{
		Sections[0].MaterialIndex = 0;
	}
}