I am using the BuildFromStaticMeshDescriptions() function to make procedural meshes at runtime.
The function has have one issue: The resulting mesh does not display the vertex colors i have fed it. The vertex colors always turn out white.
The vertex colors of my mesh description are set using this code:
for (size_t i = 0; i < vertexes_Custom.Num(); i++)
{
FVertexInstanceID vertInstanceId = FVertexInstanceID(i);
meshDescription->VertexInstanceAttributes().SetAttribute(vertInstanceId, MeshAttribute::VertexInstance::Color, 0, FVector4(1.0f, 0.0f, 0.0f, 1.0f));
}
The mesh vertex colors will always display as white, however, I can make the mesh vertex colors display their proper color by calling StaticMesh->Build(). Build() is editor only code though, so is not a solution for me.
Does anyone have any idea what may be going wrong here?