2007/07/31

Mel Script -- 抓polygon的vertex


int $n[] = `polyEvaluate -vertex pSphere1`;
int $num = $n[0];
vector $pos;

for($i=0; $i < $num; $i++)
{
 $pos = `getAttr pSphere1.vrts[$i]`; //local 座標
 //$pos = 'pointPosition -l pSphere1.vtx[$i]`; 與上行等效
 print($pos);
}

/* 與上述for loop 等效 */
//float $coord[] = `getAttr pSphere1.vrts["*"]`;
//print($coord);


for($i=0; $i < $num; $i++)
{
 $pos = `pointPosition -w pSphere1.vtx[$i]`;
 print($pos);
}

1 comment: