View Full Version : How to get Point world position from UV coordinates

09 September 2010, 02:06 AM
I don't know how to solve this problem

in maya api you can use the MitMeshPolygon and iterate over every face to find the world position by uv with the command getPointAtUv.

I know that someone else asked for this here, but that thread was closed.

Somewhere I find a suggestion to use a kd-tree, but even if I think I could learn to use this structure (to me seems like he good old "divide et impera" algorythm), I can't imagine how to apply it to this problem.

Any help will be really appreciated :)

09 September 2010, 02:34 AM
You're talking about this thread, yes?

The pointOnMesh command they describe is one of the plugins that comes in the devkit, and can be found in maya\devkit\plug-ins.

Once installed, it's callable through Python, but you'll need to use Maya Python API methods to iterate over the faces of the mesh in question. I believe Pymel has a nicer interface to pointOnMesh, but for that you have to install Pymel.

09 September 2010, 11:40 AM
But what do you want to do?

A UV comes always directly bundled with an according VertexFace. So you could just -toVertexFace via polyListComponentConversion ( and xform it:{
string $uv = "[9]";
float $pos[3] = `xform -q -t -ws (polyListComponentConversion("-toVertexFace", $uv))`;
print $pos;

but AAHHHH now I get what you are looking for: Not a uv-component but any UV value! I see I see...
Yea thats quite some meat. So the spot would have to be mapped exactly once!.. ehm good luck ^^

CGTalk Moderation
09 September 2010, 11:40 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.