View Full Version : Points on Polygon surface help

07 July 2005, 03:02 PM
I noticed that when I have a polygon surface, I choose one of the UV, the script editor says something like

select -r[65] ;

What is the mel command to obtain the corresponding x, y, z coordinates?

Also what is the API to obtain any point lying on the polygon surface?


07 July 2005, 09:27 PM
you can use the pointPosition command in mel to query the xyz of a poly point.

pointPosition -world[65];

Not sure about API.

07 July 2005, 05:51 AM
To query a vertex in a particular point in space, select the vertex & run this :

$selVert = `ls -sl -fl`;
xform -q -t $selVert;


$selVert = `ls -sl -fl`;
pointPosition $selVert;

07 July 2005, 07:37 AM
thanks both for replying will try them tonite :)

anyone knows in API what is the command to obtain all points on the polysurface?

07 July 2005, 05:06 AM
Hi, why is there an error when I try to connectAttr using pointPosition?

connectAttr (pointPosition polygon.vtx[1]) (something)

There is an error in Maya script editor if I tried to do this.. :(

07 July 2005, 07:56 AM
pointPosition polygon.vtx[1] simply returns a float[] of the xyz of vtx[1] and is not an attribute of an it can't be connected directly to another attribute. So thats why you get the error.

If your trying to do something like constrain an object to the vertex of another, I believe the only way to do that through MEL is with an expression.

Something like :

float $trans[] = `pointPosition polygon.vtx[1]`;

object.tx = $trans[0];
object.ty = $trans[1]; = $trans[2];

But someone else could correct me with a better way. Hope that helps.

CGTalk Moderation
07 July 2005, 07:56 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.