Hi everyone I just started mel scripting and ran into some problems.
The title says it all, I need to get the 3 vertices and 3 uv coords from a single face.
I looked around and could barely find things that would explain this, so I put my hope on this forum

.
(or maybe I was just looking at the wrong places?)
I tried it with the following method:
(I know it is probably rubbish, but it is as close as I could get)
for vertices:
Code:
int $skipableNumFromTokenization = 2;
string $Num=".f["+$i+"]";
string $LinkString=$obj+$Num;
//string $sArray[] = `polyListComponentConversion -fromFace -toVertex $LinkString`;
select -r $LinkString;
string $TriangleVertices[] = `polyInfo -fv`;
//print($TriangleVertices);
for($j=0;$j<3;++$j)
{
string $buffer[];
tokenizeList ($TriangleVertices[$j], $buffer);
//print($buffer);
string $Num=".vtx["+$buffer[$j+$skipableNumFromTokenization]+"]";
string $LinkString=$obj+$Num;
float $vtxPos[3] = `xform -q -ws -t $LinkString`;
if($Exportinfo==1)print("Vertex:"+$vtxPos[0]+","+$vtxPos[1]+","+$vtxPos[2]+"\n");
if($CompressionLevel==0)fprint $fileId("Vertex:");
fprint $fileId($vtxPos[0]+","+$vtxPos[1]+","+$vtxPos[2]+"\n");
}
and for the uvs:
Code:
string $Num=".f["+$i+"]";
string $LinkString=$obj+$Num;
string $sArray[] = `polyListComponentConversion -fromFace -toUV $LinkString`;
//print($sArray[0]+$sArray[1]);
$fArray = `polyEditUV -q $sArray`;
if($Exportinfo==1)print($LinkString+": "+$fArray[0]+","+$fArray[1]+","+$fArray[2]+","+$fArray[3]+","+$fArray[4]+","+$fArray[5]+"\n");
if($CompressionLevel==0)fprint $fileId("FaceUV:");
fprint $fileId($fArray[0]+","+$fArray[1]+"\n");
if($CompressionLevel==0)fprint $fileId("FaceUV:");
fprint $fileId($fArray[2]+","+$fArray[3]+"\n");
if($CompressionLevel==0)fprint $fileId("FaceUV:");
fprint $fileId($fArray[4]+","+$fArray[5]+"\n");
select -r $select;
They both seem to give me what I want (3 vertices and 3 uv coords), BUT they are in the wrong order!
Can someone help me with this code or help met find a better piece of code alltogether?
Cheers, Rik.