[C++] Get Vertex Color Value in Packaged Build

nameLive
Mon, 04 May 2020 00:21:26 +0000
C++

Hey everyone
I’m trying to get painted vertexes color values but i’m having some issues getting it to work in packaged builds.

Here i retrieve the FColorVertexBufferand and initialize it, with this i can get correct results in editor, but in the packaged build, all of the colors in the array return 221,221,221,221. Have anyone else had this issue?
Note that my mesh is set to Allow CPU Access.

Is there anything else i have to do for to get the correct values from the buffer?

I tried experimenting with FColorVertexBuffer->InitResources, UpdateRHI etc. but nothing seems to make it work.

Current:

FColorVertexBuffer* ColorBuffer = &vertexPaintDetectionHitMeshComp->GetStaticMesh()->RenderData->LODResources[0].VertexBuffers.ColorVertexBuffer;

ColorBuffer->Init(ColorBuffer->GetNumVertices(), true);

ColorBuffer->GetVertexColors(colorTestArray);

3 posts - 1 participant