I’m using Maya API 2.0 to import a mesh from a custom format.
I have the verts and polys building correctly,
and all the UV coordinates are correct - but only for the for the “first” UV shell.
what I want:
what I get:
For the remaining shells, I have discontinuous UV data
describing verts shared across polygons with different UVs
Looks like you are doing the uv operation per vertex but it should be happening per uv which as you stated are not always 1 to 1. Apologies if I am stating something obvious.
If I understand correctly, OpenMaya and MFnMesh can account for this by building an intermediate mapping of face-vertices to UVs - in your case you might need to do a pass with numpy to collect all the coordinates that are equal (as the discrete vertices to use in the UV mesh, and then build the uv mesh out of those. Then you can specify the mapping of vertices from the UV mesh, to the actual vertices in the physical mesh
Yes that is the issue. I have to chunks of UV data: a continuous chunk and a discontinuous chunk. The continuous chunk is 1 per vertex, so the array is the same length as the vertex list. I’m passing these continuous UVs to MfNMesh.create() ; this leaves out the duplicated verts with multiple UVs
The doc s around the UV args are a bit unclear; I did not realize the data needs to be in face-vertex order
It looks like I need to combine the continuous and discontinuous UV data to produce UV data that maps to the face-vertex list