How I get triangles from a skeletal mesh?

Hello,

I’m working on a Verlet integration in Unreal, and applying forces for each point in the skeletal mesh.

On the one hand, I can modify each vertex of the skeletal mesh by modifying the PositionVertexBuffer.
On the other hand, the Verlet integration seems to work well with predefined shapes in the code (I just tested it with multiple cubes).

For each face, I need to add “sticks” between vertices to maintain the shape of the polygon.

How can I get the triangles of the skeletal mesh? Is it possible to get the vertices index from a triangle?

Up please

Call function FSkeletalMeshRenderData* GetSkeletalMeshRenderData() of the USkeletalMeshComponent to get the FSkeletalMeshRenderData.You can find all Mesh Info from this Class.Then you will find FSkeletalMeshLODRenderData,and the property FMultiSizeIndexContainer of FSkeletalMeshLODRenderData store the Indices of faces.
FStaticMeshVertexBuffers this class store the Mesh’ Vertex Position、Normal、TangentX、TangentY、Vertex Color etc.

If you want know more about Mesh operation from the file “MeshUtilities.h” .

2 Likes