PDA

View Full Version : getting WorldSPaceCoordinates from UV Coordinates


Phlok
01-12-2011, 07:29 PM
Hi,

if I have the UV coords of a point on a mesh (with a UV Layout, of course)- how can I get this point's coordinates in world space? Unfortunately, I haven't found anything useful in MEL for doing so- maybe I just overlooked something. Is there any command that might get me there? Thanks for all hints!

pixelranger
01-12-2011, 07:59 PM
pointOnMesh gives you this info, providing that you feed it a face index and a UV coordinate. (Bonus Tools)

norbertnacu
01-13-2011, 08:43 PM
global proc float[] nnGetXYZPos()
{
float $result[];
string $uvs[] = `filterExpand -sm 35`;

if( size($uvs) == 0 )
{
warning( "No uv point(s) selected" );
return $result;
}

PolySelectConvert 3;

string $vtx[] = `filterExpand -sm 31`;

for( $vt in $vtx )
{
float $pos[] = `xform -q -ws -t $vt`;
$result[size($result)] = $pos[0];
$result[size($result)] = $pos[1];
$result[size($result)] = $pos[2];
}

select $uvs;
return $result;
}

CGTalk Moderation
01-13-2011, 08:43 PM
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.