pymel.core.system.fileBrowserDialog

fileBrowserDialog(*args, **kwargs)

The fileBrowserDialog and fileDialog commands have now been deprecated. Both commands are still callable, but it is recommended that the fileDialog2 command be used instead. To maintain some backwards compatibility, both fileBrowserDialog and fileDialog will convert the flags/values passed to them into the appropriate flags/values that the fileDialog2 command uses and will call that command internally. It is not guaranteed that this compatibility will be able to be maintained in future versions so any new scripts that are written should use fileDialog2. See below for an example of how to change a script to use fileDialog2.

Flags:
Long name (short name) Argument Types Properties
actionName (an) unicode ../../../_images/create.gif
 
Script to be called when the file is validated.
dialogStyle (ds) int ../../../_images/create.gif
 
0 for old style dialog1 for Windows 2000 style Explorer style2 for Explorer style with “Shortcut” tip at bottom
fileCommand (fc) script ../../../_images/create.gif
 
The script to run on command action
fileType (ft) unicode ../../../_images/create.gif
 

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 ../../../_images/create.gif
 

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 ../../../_images/create.gif
 

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 ../../../_images/create.gif
 

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 ../../../_images/create.gif
 
Enables the option dialog. Valid strings are: “Import”“Reference”“SaveAs”“ExportAll”“ExportActive”
tipMessage (tm) unicode ../../../_images/create.gif
 
Message to be displayed at the bottom of the style 2 dialog box.
windowTitle (wt) unicode ../../../_images/create.gif
 
Set the window title of a style 1 or 2 dialog boxFlag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list.

Derived from mel command maya.cmds.fileBrowserDialog

Example:

import pymel.core as pm

# Old way:
def importImage( fileName, fileType):
   pm.file( fileName, i=True );
   return 1

pm.fileBrowserDialog( m=0, fc=importImage, ft='image', an='Import_Image', om='Import' )

# Recommended way:
filename = pm.fileDialog2(fileMode=1, caption="Import Image")
pm.file( filename[0], i=True );

Previous topic

pymel.core.system.feof

Next topic

pymel.core.system.fileDialog

Core

Core Modules

Other Modules

This Page