The fileBrowserDialog command offers more control of the windows file browser dialog. See the fileDialog command for cross platform file dialog support.
Long name (short name) | Argument Types | Properties | |
---|---|---|---|
actionName (an) | unicode | ||
|
|||
dialogStyle (ds) | int | ||
|
|||
fileCommand (fc) | callable | ||
|
|||
fileType (ft) | unicode | ||
Set the type of file to filter. By default this can be any one of: mayaAscii, mayaBinary, mel, OBJ, directory, plug-in, audio, move, EPS, Illustrator, image. plug-ins may define their own types as well. |
|||
filterList (fl) | unicode | ||
Specify file filters. Used with dialog style 1 and 2. Each string should be a description followed by a comma followed by a semi-colon separated list of file extensions with wildcard. |
|||
includeName (includeName) | unicode | ||
Include the given string after the actionName in parentheses. If the name is too long, it will be shortened to fit on the dialog (for example, /usr/alias/commands/scripts/fileBrowser.mel might be shortened to /usr/...pts/fileBrowser.mel) |
|||
mode (m) | int | ||
Defines the mode in which to run the file brower: 0 for read1 for write2 for write without paths (segmented files)4 for directories have meaning when used with the action+100 for returning short names |
|||
operationMode (om) | unicode | ||
|
|||
tipMessage (tm) | unicode | ||
|
|||
windowTitle (wt) | unicode | ||
|
Derived from mel command maya.cmds.fileBrowserDialog
Example:
import pymel.core as pm
def importImage( fileName, fileType):
pm.file( fileName, i=True );
return 1
pm.fileBrowserDialog( m=0, fc=importImage, ft='image', an='Import_Image', om='Import' )
# Result: True #