In general, I have the following starting point:
There is a position in 3d object space (a new vertex) which should receive an appropriate UVPosition relative to a specific face.
The newVtx may lay inside or outside the face, but a proper UV should be extrapolated even if the vtx lays outside.
Since I extract all the meshdata from Maya, and work on it using my own routines, and pass it back to Maya, I should implement everything on my own.
Being precise, it I need to properly sample UVs for a solidChamfer/chamfer algorithm which is supposed to keep the UVs.
My approach would be (and partly is) as follows:
First: Create the newVertices/Position
Second: Find the closest point on the specific face. This would be another slight problem since I would need to triangulate it first. I think maya uses delauney triangulation by default, but it is not implemented yet in my own “mesh manager”. Finally, finding the closest point on a triangle shouldn`t be a problem :).
Third: Find an appropriate UVPosition. I already have some sampling algorithm, but it seems to be different from the one used by Maya, so you see distortions - more or less intense.
It is not based on the actual mesh triangles - perhaps thats the/one of the reason(s).
So my final question is: Does anyone know which algorithm is exactly used to sample a UV Position according to a specific XYZ point?
Is it completely based on triangles as I assume now?
I really do not want to use the procedures available in MFnMesh since it will check the whole UVSet (instead of just on specific face ), and I think it will fail if there is no UV at this position.
I don`t know if I could explain it so very well, which is why I attached a screencapture :).
Please have a look! (5MB; WMV)
Thanks,
Byron

.