2007年04月04日

UV列挙サンプル

//[MEL] UV列挙サンプル
proc getTexturingCoords( string $mesh )
{
 // get number of uvs on the mesh
 int $uvCount[] = `polyEvaluate -uv $mesh`;

 // write the number of UV coords
 print( "numTexCoords=" + $uvCount[0] + "\n" );

 // add each uv coord to the string also
 for( $i=0;$i<$uvCount[0];$i++)
 {
  // get the uv coord
  float $uvs[] = `getAttr ($mesh + ".uv[" +$i+"]")`;

  // print it's value
  print( $uvs[0] + " " + $uvs[1] + "\n" );
  
  if( 1.0 < $uvs[0] || 0.0 > $uvs[0] || 1.0 < $uvs[1] || 0.0 > $uvs[1] ){
   select -r ($mesh + ".map[" + $i + "]");
  }
 }
}
string $tmp[] = `ls -sl`;
select -clear;
getTexturingCoords($tmp[0]);

posted by toka at 23:44| Comment(0) | TrackBack(0) | MEL | このブログの読者になる | 更新情報をチェックする
この記事へのコメント
コメントを書く
お名前:

メールアドレス:

ホームページアドレス:

コメント:


この記事へのトラックバック
×

この広告は90日以上新しい記事の投稿がないブログに表示されております。