Hello.
I’m developing a modifier to modify the vertex color channel of an object. I already know how to deal with Mesh from TriObject, but I also need the equivalent for MNMesh (PolyObj). Does someone know how to make it correctly?
This is my code for Mesh:
Mesh& mesh = triobj->GetMesh();
int NumVertexColors = mesh.getNumVerts();
BOOL bRes = mesh.setNumVertCol(NumVertexColors);
if (!bRes) return;
const int NumFaces = mesh.getNumFaces();
bRes = mesh.setNumVCFaces(NumFaces);
if (!bRes) return;
VertColor *vertCol = mesh.vertCol; //array of Point3 vertex colors
if (!vertCol) return;
TVFace *vcFace = mesh.vcFace; //texture faces
Face* faces = mesh.faces; //faces of my mesh, to convert texture vert index to the geometry vert index
for (int iFace=0;iFace<NumFaces;++iFace)
{
for (int j=0;j<3;++j)
{
int vertIndex = faces[iFace].v[j];
vcFace[iFace].t[j] = vertIndex; //each texture vertex is assigned to its geom vertex
}
}
