Although I have experience in C++ but I am new to MEL and I have problems with alot of MEL syntax. Basically, I wanted to create a MEL to perform some simple selection of vertices base on their positions.
Say I need to select all vertices that are on the Yaxis (with the vertices X value=0 +-tolerance). This is what I have written, it doesn't work, of course, due to my lack of knowledge of some syntax:
for ( $i=0; $i<=LASTVERTEXNUMBER; $i++)
{
if (objectname.vtx[i[]] XVALUE>= $min_tolerance)&&
(objectname.vtx[i[]] XVALUE><= $max_tolerance)then
{
select -tgl objectname.vtx[i[]];
}
}
I need the actual syntax of the bolded word.
Q1)How to determine the last vertex number?
Q2) What is the syntax to get the absolute (or world coordinate) value of its X, Y and Z coordinates?
( I can query the value using "xform -q -ws -t objectname.vtx but I don't know how to use in an expression like a=b;)