Crash - using MFnMesh::setFaceVertexNormals
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
We have a mesh translator for importing/exporting from/to our own format. When creating the mesh without UVs, via create() method, MStatus returns kSuccess.
Once this is done, the normals are set via setFaceVertexNormals (in one call for efficiency).
The documentation of the methods mentions that
"Set Normals for the given face/vertex pairs. Note that if there is a vertex-face mismatch anywhere in the list, this method will return an error, and not set any of the normals.". However, we are experiencing a crash if we have a badly formed polygon.
For example, we have a customer case, were the last face of a mesh has some vertexIDs looking like '10,11,12,10,13', which does look like a poor face (notice the loop on four first IDs, then adding one). This asset was exported from a maya mesh already having this bad format. It is odd that the symmetric method getFaceVertexNormals() for a given poly does return the normals for this face.
Using setFaceVertexNormal() (single normal version) on each face allowed to determine that this face is faulty : it does return kInvalidParameter (& internal code 18) when setting this face normal. But the array based setFaceVertexNormals() crashes with the same content.
Is this crash already logged on your side ?
How could we reliably detect unsuitable geometry before this crash ?