シェルフ作成mel
{ // global化対策
// ボタン作成Proc
proc createShelfButton(string $labelName, string $image, string $command, string $doubleClickCommand, string $labelList[]){
if(!stringArrayContains($labelName, $labelList)){
shelfButton
-label $labelName
-annotation $labelName
-image $image
-command $command
-doubleClickCommand $doubleClickCommand
;
}
}
string $newShelfName = "Kohaku_DagMenu";
if(!`shelfLayout -exists $newShelfName`){
addNewShelfTab $newShelfName;
}
string $shelfButtonName[] = `shelfLayout -q -childArray $newShelfName`;
string $labelList[], $labelName, $command;
for($name in $shelfButtonName){
$labelName = `shelfButton -q -label $name`;
appendStringArray($labelList, {$labelName}, 1);
}
setParent $newShelfName;
$labelName = uiRes("m_commonSelectOptionsPopup.kClearSelect");
createShelfButton($labelName, $image = "commandButton.png", $command = "select -clear", $doubleClickCommand = "", $labelList);
$labelName = uiRes("m_defaultRunTimeCommands.kDeselectLbl");
createShelfButton($labelName, $image = "commandButton.png", $command = "SelectNone;", $doubleClickCommand = "", $labelList);
$labelName = uiRes("m_defaultRunTimeCommands.kEnableSelectToolLbl");
createShelfButton($labelName, $image = "aselect.png", $command = "SelectTool", $doubleClickCommand = "SelectTool; ToolSettingsWindow", $labelList);
$labelName = uiRes("m_createModelPanelMenu.kFrameSelectionWithoutChildren");
createShelfButton($labelName, $image = "commandButton.png", $command = "fitPanel -selectedNoChildren", $doubleClickCommand = "", $labelList);
$labelName = uiRes("s_TtumbleContextStrings.rTumbleToolName");
createShelfButton($labelName, $image = "tumble.png", $command = "TumbleTool", $doubleClickCommand = "TumbleTool; ToolSettingsWindow", $labelList);
$labelName = uiRes("s_TtrackContextStrings.rTrackToolName");
createShelfButton($labelName, $image = "track.png", $command = "TrackTool", $doubleClickCommand = "TrackTool; ToolSettingsWindow", $labelList);
$labelName = uiRes("m_defaultRunTimeCommands.kMoveToolLbl");
createShelfButton($labelName, $image = "move_M.png", $command = "MoveTool", $doubleClickCommand = "MoveToolOptions", $labelList);
$labelName = uiRes("m_createModelPanelMenu.kIsolateSelect");
$command
= "// Kohaku_dagMenuCheckBoxFlg:Start\n"
+ "proc int isolateSelectFlg(){\n"
+ " string $currentView = `getPanel -withFocus`;\n"
+ " return `isolateSelect -q -state $currentView`;\n"
+ "}\n"
+ "isolateSelectFlg;\n"
+ "// Kohaku_dagMenuCheckBoxFlg:End\n"
+ "ToggleIsolateSelect;"
;
createShelfButton($labelName, $image = "commandButton.png", $command, $doubleClickCommand = "", $labelList);
}