fileDialog2 [-buttonBoxOrientation int] [-cancelCaption string] [-caption string] [-dialogStyle int] [-fileFilter string] [-fileMode int] [-fileTypeChanged script] [-hideNameEdit] [-okCaption string] [-optionsUICancel script] [-optionsUICommit script] [-optionsUICommit2 script] [-optionsUICreate script] [-optionsUIInit script] [-optionsUITitle string] [-returnFilter boolean] [-selectFileFilter string] [-selectionChanged script] [-setProjectBtnEnabled boolean] [-startingDirectory string]
fileDialog2 は、取り消し可能、照会不可能、および編集不可能です。
ファイルまたはディレクトリを選択できるダイアログが設定されます。| string | 配列 |
| ロング ネーム(ショート ネーム) | 引数タイプ | プロパティ | ||
|---|---|---|---|---|
-buttonBoxOrientation(-bbo)
|
int
|
|
||
|
||||
-cancelCaption(-cc)
|
string
|
|
||
|
||||
-caption(-cap)
|
string
|
|
||
|
||||
-dialogStyle(-ds)
|
int
|
|
||
|
||||
-fileFilter(-ff)
|
string
|
|
||
|
||||
-fileMode(-fm)
|
int
|
|
||
|
||||
-fileTypeChanged(-ftc)
|
script
|
|
||
|
||||
-hideNameEdit(-hne)
|
|
|
||
|
||||
-okCaption(-okc)
|
string
|
|
||
|
||||
-optionsUICancel(-oca)
|
script
|
|
||
|
||||
-optionsUICommit(-ocm)
|
script
|
|
||
|
||||
-optionsUICommit2(-oc2)
|
script
|
|
||
|
||||
-optionsUICreate(-ocr)
|
script
|
|
||
|
||||
-optionsUIInit(-oin)
|
script
|
|
||
|
||||
-optionsUITitle(-oti)
|
string
|
|
||
|
||||
-returnFilter(-rf)
|
boolean
|
|
||
|
||||
-selectFileFilter(-sff)
|
string
|
|
||
|
||||
-selectionChanged(-sc)
|
script
|
|
||
|
||||
-setProjectBtnEnabled(-spe)
|
boolean
|
|
||
|
||||
-startingDirectory(-dir)
|
string
|
|
||
|
||||
// Single file filter with no description.
string $basicFilter = "*.mb";
string $result[] = `fileDialog2 -fileFilter $basicFilter -dialogStyle 2`;
// Single filter with a description.
string $singleFilter = "All Files (*.*)";
string $result[] = `fileDialog2 -fileFilter $singleFilter -dialogStyle 2`;
// Multiple filters separated by double semi-colons. The first filter has multiple file types.
string $multipleFilters = "Maya Files (*.ma *.mb);;Maya ASCII (*.ma);;Maya Binary (*.mb);;All Files (*.*)";
string $result[] = `fileDialog2 -fileFilter $multipleFilters -selectFileFilter "Maya Binary" -dialogStyle 2`;
//
// An example of how to add UI to the Maya file dialog.
//
global proc MyCustomOptionsUISetup(string $parent)
{
setParent $parent;
$parent = `scrollLayout -childResizable true`;
// generate some UI which will show up in the options tab of the Maya file dialog
columnLayout -adj true;
iconTextRadioCollection itRadCollection;
iconTextRadioButton -st "iconAndTextVertical" -i1 "sphere.png" -l "sphere" SphereIconButton;
iconTextRadioButton -st "iconAndTextVertical" -i1 "cone.png" -l "cone" ConeIconButton;
iconTextRadioButton -st "iconAndTextVertical" -i1 "cube.png" -l "cube" -select CubeIconButton;
}
global proc MyCustomOptionsUIInitValues(string $parent, string $filterType)
{
setParent $parent;
if (`optionVar -exists MyCustomUIOptVar`)
{
string $selected = `optionVar -q MyCustomUIOptVar`;
iconTextRadioCollection -edit -select $selected itRadCollection;
}
}
global proc MyCustomOptionsUICommit(string $parent)
{
setParent $parent;
optionVar -sv MyCustomUIOptVar `iconTextRadioCollection -q -select itRadCollection`;
}
global proc MyCustomSelectionChanged(string $parent, string $selection)
{
setParent $parent;
print ("$selection: " + $selection + "\n");
}
global proc MyCustomFileTypeChanged(string $parent, string $newType)
{
setParent $parent;
print ("$newType: " + $newType + "\n");
}
fileDialog2 -fileFilter "Maya Binary (*.mb);;Maya ASCII (*.ma);;All Files (*.*)"
-optionsUICreate "MyCustomOptionsUISetup"
-optionsUIInit "MyCustomOptionsUIInitValues"
-optionsUICommit "MyCustomOptionsUICommit"
-fileTypeChanged "MyCustomFileTypeChanged"
-selectionChanged "MyCustomSelectionChanged";