With a static mesh, I can get:
- vertex positions from mesh->RenderData->LODResources[0].VertexBuffers.PositionVertexBuffer;
- vertex indexes from mesh->RenderData->LODResources[0].IndexBuffer.GetArrayView();
I am guessing I can get UVs and tangets from:
- VertexBuffers.StaticMeshVertexBuffer.GetVertexUV(), and
- VertexBuffers.StaticMeshVertexBuffer.GetTangentData()
But I don’t know about normals. How can I get vertex normals from a static mesh?
Alternatively, I found this:
How can I get polygon normals of a static mesh? - Rendering - Unreal Engine Forums
This appears to be just what I was looking for, however I don’t find that it works. In particular:
- LODResources[0], 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.