I’m having a problem retrieving the normals of some edit meshes, they are something like a flat geometry, it works ok with Edit Poly but the weird fact is that if I convert it to Edit Poly and back to Mesh it works ok.
MeshNormalSpec *getSpecifiedNormalsFromMesh(Mesh* mesh)
{
MeshNormalSpec *normalSpec = mesh->GetSpecifiedNormals();
if (normalSpec == NULL)
{
mesh->SpecifyNormals();
normalSpec = mesh->GetSpecifiedNormals();
}
if (normalSpec->GetNumNormals() == 0)
{
normalSpec->SetParent(mesh);
normalSpec->CheckNormals();
}
if (normalSpec == NULL)
return NULL;
bool isSetMESH_NORMAL_NORMALS_BUILT = normalSpec->GetFlag(MESH_NORMAL_NORMALS_BUILT);
bool isSetMESH_NORMAL_NORMALS_COMPUTED = normalSpec->GetFlag(MESH_NORMAL_NORMALS_COMPUTED);
bool isSetMESH_NORMAL_MODIFIER_SUPPORT = normalSpec->GetFlag(MESH_NORMAL_MODIFIER_SUPPORT);
if (!isSetMESH_NORMAL_NORMALS_BUILT || !isSetMESH_NORMAL_NORMALS_COMPUTED)
{
normalSpec->SetParent(mesh);
normalSpec->CheckNormals();
}
if (normalSpec->GetNumNormals() == 0)
{
normalSpec->SetParent(mesh);
normalSpec->CheckNormals();
}
return normalSpec;
}
Called from:
if (objectState->obj->IsSubClassOf(triObjectClassID)) {
TriObject *triOb = (TriObject*)objectState->obj;
getSpecifiedNormalsFromMesh(triOb->GetMesh());
}
Any thought on this?



