Hey, all:
I wanna get the number of model’s faces through C API. And the following is my code segment:
VERTEX_API int getNumofFaces(const char* filename) {
SUModelRef model = SU_INVALID;
if (SUModelCreateFromFile(&model,filename) != SU_ERROR_NONE)
return -1;
SUModelStatistics* statistics = SU_INVALID;
SU_CALL(SUModelGetStatistics(model, statistics));
int number = statistics->entity_counts[statistics->SUEntityType_Face];
SU_CALL(SUModelRelease(&model));
return number;
}
However, it throws an exception: access violation reading xxx…So, what’s the right way to get the count of faces?
Thanks in advance.