// [MEL] メッシュ頂点の位置を列挙するサンプル
{
string $selected[] = `ls -sl`;
string $obj = $selected[0];float $pos[];
int $nVerts[] = `polyEvaluate -v $obj`;
int $nVert = $nVerts[0];
int $i, $j;for( $i=0; $i<$nVert; $i++){
$pos = `pointPosition -local ($obj + ".vtx[" + $i + "]")`;
print ("< " + $pos[0] + ", " + $pos[1] + ", " + $pos[2] + " >\n");
}
int $nFaces[] = `polyEvaluate -f $obj`;
int $nFace = $nFaces[0];
string $face[];
string $buf[];for( $i=0; $i<$nFace; $i++){
$face = `polyInfo -fv ($obj + ".f[" + $i + "]")`;
$face[0] = `substitute "\n$" $face[0] ""`;
tokenize $face[0] " " $buf;
for( $j=2; $j<size($buf); $j++){
print ($buf[$j] + " ");
}
print "\n";
}
}
2007年04月04日
メッシュ頂点の位置を列挙するサンプル
この記事へのコメント
コメントを書く
この記事へのトラックバック