Editing RawMesh.WedgeColors

Hi all.

I need to edit the color of the triangles of a mesh in C++. I’m having a lot of problems doing that, mainly because each change I do causes the crash of the engine, then the project gets broken and cannot be opened again (even after reverting the changes to the original repository state).

There isn’t documentation on how to use/edit this low level information. When I elements to WedgeColors array (initially empty) the engine crashes. The only thing I could do was change the material of the mesh, by adding a material to the StaticMesh.Materials array and editing the RawMesh.FaceMaterialIndices. I tried loading a material with a BaseColor parameter too, but the engine crashes when I create a dynamic material instance based on this material.

Is there a way to paint the triangles by editing the WedgeColors array without create or edit the material of the faces?

Thank you for any idea to solve this.