Victory Plugin for 5.0.2 With New Nodes (Yes!!!)
The Nodes listed in above posts have been added!
Annnndβ¦
Get Static Mesh Vertex Positions (Scaled, Rotated, & Translated!)
is BACK
The C++ Code
//Build.cs "MeshDescription"
#include "StaticMeshDescription.h"
bool URamaCodePluginBPLibrary::GetStaticMeshVertexLocations(UStaticMeshComponent* Comp, TArray<FVector>& VertexPositions, int32 LodIndex)
{
if(!Comp)
{
return false;
}
TObjectPtr<UStaticMesh> MeshPtr = Comp->GetStaticMesh();
if(!MeshPtr)
{
return false;
}
UStaticMeshDescription* Desc = MeshPtr->GetStaticMeshDescription(LodIndex);
if(!Desc)
{
return false;
}
FTransform WorldTransform = Comp->GetComponentTransform();
FVertexArray& Verts = Desc->Vertices();
for (FVertexID EachVertId : Verts.GetElementIDs())
{
VertexPositions.Add(
WorldTransform.TransformPosition( Desc->GetVertexPosition(EachVertId) )
);
}
return true;
}
Enjoy!