Download

How to access Cooked LOD Info to get Painted Vertice color data in packaged project?

Hey!

I am working on a Vertex Paint Detection Plugin where the goal is to detect what amount of RGBA is painted on a vertice.

I’ve managed to get this working well in editor by using Mesh>LODData>PaintedVertices, however as it turns out the LODData gets serialized or something when cooked so in build the color array returns 0.

I’ve tried using the FColorVertexBuffer instead which returns the right number of vertices of the mesh, even in build. However, the color values from FColorVertexBuffer>GetVertexColors are not correct, they are all Default Red (255,0,0,255) for some reason both in editor and in build, which leads me to think i may have to do something else with it but can’t figure it out.

Do the Color Vertex Buffer have to be initialized in a way for it to get the actual color data of each vertice?

Current:

colVertBuffer = &staticMesh->RenderData->LODResources[lodData].VertexBuffers.ColorVertexBuffer;

colVertBuffer->GetVertexColors(paintedVerts);