When selecting 2 edges on a mesh in the order 0, 1; then converting the selection to vertices, I would expect maya to give me the order of the vertices in the order that I selected the edges. I now realize that was wishful thinking. Does anyone know how I could go about keeping the selection order in order?
This code creates a cube and selects edges 7 and 5 respectively. It then converts selection to vertices and prints out the array, however it prints it out in vertex number order from least to greatest instead of selection order.
CODE
polyCube -n "testCube";
select -cl;
select -r testCube.e[7];
select -tgl testCube.e[5];
string $dhU_selection[] = ls -sl -fl;
string $dhU_convertedEdges[] = polyListComponentConversion -tv;
string $dhU_selectedVertices[] = ls -fl $dhU\_convertedEdges;
for($vert in $dhU_selectedVertices)
{
float $vertWSloc[] = xform -q -ws -t $vert;
print ($vert + " found at: \n" + $vertWSloc[0] + " " + $vertWSloc[1] + " " + $vertWSloc[2] + "\n \n");
}
This is the same bit of code only slightly modified. It creates a cube, selects the vertices 5,3,1 in their respective order and prints out the array contents. Once again, it prints it out in vertex number order from least to greatest.
CODE
polyCube -n "testCube";
select -cl;
select -r testCube.v[5];
select -tgl testCube.v[3];
select -tgl testCube.v[1];
string $dhU_selection[] = ls -sl -fl;
string $dhU_convertedEdges[] = polyListComponentConversion -tv;
string $dhU_selectedVertices[] = ls -fl -sl;
for($vert in $dhU_selectedVertices)
{
float $vertWSloc[] = xform -q -ws -t $vert;
print ($vert + " found at: \n" + $vertWSloc[0] + " " + $vertWSloc[1] + " " + $vertWSloc[2] + "\n \n");
}
Same things happens with edge components. Is there no way to keep the selection order?