ImageEngine/cortex — pull request #264 by andrewkaufman (2014-05-06 19:44:33+00:00)
Title: Mesh converter crash with many UV sets

When calling fnMesh.numFaceVertices() (and other MFnMesh API calls), given a mesh with 6 or more UV sets, which has never been evaluated before, the first call throws kFailure. From within the ToMayaMeshConverter itself, the output plug appears fine, and the API calls evaluate as expected. Despite this, the resulting mesh cannot be evaluated on the first try. Making the mesh visible, or making any attempt to evaluate it, will trigger some unknown internal updating, and subsequent attempts to evaluate it will succeed. Meshes with 5 or less UV sets do not suffer from this problem.

I've added a test to FromMayaMeshConverter which demonstrates how this issue can cause a seg fault, and I've patched FromMayaMeshConverter with a silly fix, so the problem does not occur. Unfortunately, I could find no solution that solved the overall problem, and I've added a test to ToMayaMeshConverter which demonstrates the issue.

I also patched a failing test in ToMayaMeshConverter which was just a precision issue with the test itself.