How-To: Check if vertex of shell has vertex colors/normals

3DF
When you want to check if the attribute is set or not, you can use Show_Existence before you call Show_(Attribute).

If you want to check vertices have vertex colors or vertex normals, you can use the filters “vertex colors” or “vertex normals”.

HC_KEY key = HC_Insert_Shell(pcount, pts, flist_count, faces);
HC_MSet_Vertex_Colors_By_Value(key, "face", 0, "RGB", 8, colors);
HC_MSet_Vertex_Normals(key, 0, 8, normals);

int colorsize = HC_Show_Existence_By_Key(key, "vertex colors");
int normalsize = HC_Show_Existence_By_Key(key, "vertex normals");
   
HC_Open_Geometry(key);
{
   HC_Open_Vertex(offset);
  {
     colorsize = HC_Show_Existence("vertex colors");
     normalsize = HC_Show_Existence("vertex normals");
  }
  HC_Close_Vertex();
}
HC_Close_Geometry();
2 Likes