SetEdgeVisibility (C++)


#1

I wrote a modifier plugin that will set the visibility of edges on trimesh. my question is how I can find border edges and exclude them from this change? In other word I want to keep border edges untouched. This is my function that my thought was should work, but I don’t know why it’s not working as expected:


void ModifyTriObject(TimeValue t, ModContext &mc, TriObject *tobj)
{
   Interval iv = FOREVER;
   int i, j;
   Mesh &mesh = tobj->GetMesh();
   BitArray openEdges;
   mesh.FindOpenEdges(openEdges);
   for (i = 0; i < mesh.numFaces; i++)
   {
      for (j = 0; j < 3; j++)
      {
         mesh.faces[i].setEdgeVis(j, openEdges[i*j]);
      }
   }
   mesh.InvalidateTopologyCache();
   tobj->UpdateValidity(GEOM_CHAN_NUM, iv);
}


#2

Try:


openEdges[i*3+j]


#3

Thank You!