Hey guys, I am working on a nongame project and I have to get the world space vertex position of skinned mesh after morph is applied.
Now that is the problem because morph is happening on GPU. So because the speed is not the problem for me, my quick and dirty solution was to switch to SetCPUSkinningEnabled to true just once, then get all vertex positions I needed, and then SetCPUSkinningEnabled to false again.
Something like this:
if (Mesh->GetCPUSkinningEnabled()) {
TArray<FFinalSkinVertex> SkinnedVertices;
Mesh->GetCPUSkinnedVertices(SkinnedVertices, LODIndex);
if(index<SkinnedVertices.Num())
{
const FTransform ToWorld = Mesh->GetComponentTransform();
auto p = SkinnedVertices[index].Position;
Location = ToWorld.TransformPosition(FVector(p.X,p.Y,p.Z));
}
That was working well until UE 5.3.1. In UE 5.3.1 it works in the editor but not in packed projects. I am not sure why. I have two questions, is there another better way to get the world vertex position? Is there something I am missing why is it not working in the packaged project?
Any help would be great, thanks in advance!
Cheers!