2006年06月25日

ビュー切り替えコマンド改良版

以前に作ったホットキー割当用のMELを修正。
front←→back等の切り替えも出来るようにした。

 

//switchFrontView
proc toka_switchFrontView(){
 float $rot;
 if( "front" == (`lookThru -q`) ){
  setAttr "front.tz" ((`getAttr "front.tz"`)*-1.0);
  $rot = `getAttr "front.ry"`;
  if( 180 <= $rot ) $rot -= 180;
  else $rot += 180;
  setAttr "front.ry" $rot;
 }else{
  lookThru front;
 }
}
toka_switchFrontView();

 

//switchSideView
proc toka_switchSideView(){
 float $rot;
 if( "side" == (`lookThru -q`) ){
  setAttr "side.tx" ((`getAttr "side.tx"`)*-1.0);
  $rot = `getAttr "side.ry"`;
  if( 90 <= $rot ) $rot -= 180;
  else $rot += 180;
  setAttr "side.ry" $rot;
 }else{
  lookThru side;
 }
}
toka_switchSideView();

 

//switchTopView
proc toka_switchTopView(){
 float $rot;
 if( "top" == (`lookThru -q`) ){
  setAttr "top.ty" ((`getAttr "top.ty"`)*-1.0);
  $rot = `getAttr "top.rx"`;
  if( 90 <= $rot ) $rot -= 180;
  else $rot += 180;
  setAttr "top.rx" $rot;
 }else{
  lookThru top;
 }
}
toka_switchTopView();

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

メールアドレス:

ホームページアドレス:

コメント:


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

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