PDA

View Full Version : Points on Polygon surface help


eudora
07-10-2005, 04: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 nurbsToPoly1.map[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?

Thanks

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

pointPosition -world nurbsToPoly1.map[65];

Not sure about API.

SajNT
07-11-2005, 06: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;

or

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

eudora
07-11-2005, 08: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?

eudora
07-13-2005, 06:06 AM
Hi, why is there an error when I try to connectAttr using pointPosition?
eg.

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

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

FiendishVegan
07-13-2005, 08:56 AM
pointPosition polygon.vtx[1] simply returns a float[] of the xyz of vtx[1] and is not an attribute of an object...so 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];
object.tz = $trans[2];

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

CGTalk Moderation
07-13-2005, 08: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.