Using the Runtime Mesh Component plugin, creating a runtime mesh requires the set of vertex normals (among other things) to be passed in. I was intending to do this by getting all needed data from a static mesh already in the level.
With a static mesh, I am able to get:
- vertex positions from mesh->RenderData->LODResources.VertexBuffers.PositionVertexBuffer;
- vertex indexes from mesh->RenderData->LODResources.IndexBuffer.GetArrayView();
I am guessing I can also get UVs and tangents from:
- VertexBuffers.StaticMeshVertexBuffer.GetVertexUV(), and
But how do I get the mesh’s vertex normals? [HR][/HR]
Alternatively, I found this: How can I get polygon normals of a static mesh? - UE4 AnswerHub
This appears to be just what I was looking for, however I don’t find that it works. In particular:
- LODResources, which is a FStaticMeshLODResources, has no “VertexBuffer” member, and
- VertexBuffers, which is a FStaticMeshVertexBuffers, has no GetTangentZ() function.
Perhaps I am missing something simple with that answer though.