ShelfLayoutをそもそも使っていれば何の問題もないけど、
さまざまな理由から、遠回りをしたいとき。
例えば右クリック⇒現在のMayaシェルフに登録などさせる場合、
現在アクティブなシェルフレイアウトの名前を取得したい。
そんな時はこちら。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
proc string getActiveShelfLayout(){ | |
string $uiList[] = `lsUI -type "shelfLayout"`; | |
string $tabList[] = `lsUI -type "tabLayout"`; | |
if (!(stringArrayFind("ShelfLayout",0,$tabList))) return ""; | |
string $tl=`tabLayout -q -st "ShelfLayout"`; | |
if (!(stringArrayFind($tl,0,$uiList))) return ""; | |
return $tl; | |
} | |
print getActiveShelfLayout; |