Functions and classes relating to files, references, and system calls.
In particular, the system module contains the functionality of maya.cmds.file. The file command should not be imported into the default namespace because it conflicts with python’s builtin file class. Since the file command has so many flags, we decided to kill two birds with one stone: by breaking the file command down into multiple functions – one for each primary flag – the resulting functions are more readable and allow the file command’s functionality to be used directly within the pymel namespace.
for example, instead of this:
>>> expFile = cmds.file( '/var/tmp/test.ma', exportAll=1, preserveReferences=1, type='mayaAscii', force=1 )
you can do this:
>>> expFile = exportAll( '/var/tmp/test.ma', preserveReferences=1, force=1)
>>> expFile
Path('/var/tmp/test.ma')
some of the new commands were changed slightly from their flag name to avoid name clashes and to add to readability:
>>> importFile( expFile ) # flag was called import, but that's a python keyword
>>> createReference( expFile )
FileReference(u'testRN', u'/var/tmp/test.ma')
Also, note that the ‘type’ flag is set automatically for you when your path includes a ‘.mb’ or ‘.ma’ extension.
| assignInputDevice | This command associates a command string (i.e. |
| attachDeviceAttr | This command associates a device/axis pair with a node/attribute pair. |
| attrCompatibility | This command is used to handle compatibility issues between file format versions by providing a mechanism to describe differences between two versions. |
| cacheFile | Creates one or more cache files on disk to store attribute data for a span of frames. |
| cacheFileCombine | Creates a cacheBlend node that can be used to combine, layer or blend multiple cacheFiles for a given object. |
| cacheFileMerge | If selected/specified caches can be successfully merged, will return the start/end frames of the new cache followed by the start/end frames of any gaps in the merged cache for which no data should be written to file. |
| cacheFileTrack | This command is used for inserting and removing tracks related to the caches displayed in the trax editor. |
| clearCache | Even though dependency graph values are computed or dirty they may still occupy space temporarily within the nodes. |
| cmdFileOutput | This command will open a text file to receive all of the commands and results that normally get printed to the Script Editor window or console. The file will stay open until an explicit -close with the correct file descriptor or a -closeAll, so care should be taken not to leave a file open. To enable logging to commence as soon as Maya starts up, the environment variable MAYA_CMD_FILE_OUTPUT may be specified prior to launching Maya. Setting MAYA_CMD_FILE_OUTPUT to a filename will create and output to that given file. To access the descriptor after Maya has started, use the -query and -open flags together. |
| convertUnit | This command converts values between different units of measure. |
| createReference |
|
| date | Returns information about current time and date. |
| decorator | Decorator for decorators. |
| detachDeviceAttr | This command detaches connections between device axes and node attributes. |
| deviceEditor | This creates an editor for creating/modifying attachments to input devices. |
| devicePanel | This creates a panel containing an editor for creating/modifying attachments to input devices. |
| dgInfo | This command prints information about the DG in a text-oriented manner. The scope of the information printed is the entire graph if the -all flag is used, the nodes/plugs on the command line if they were specified, and the selection list, in that order. |
| dgdirty | The dgdirtycommand is used to force a dependency graph dirty message on a node or plug. |
| dgeval | The dgevalcommand is used to force a dependency graph evaluate of a node or plug. |
| dgtimer | This command measures dependency graph node performance by managing timers on a per-node basis. |
| dirmap | Use this command to map a directory to another directory. |
| diskCache | Command to create, clear, or close disk cache(s). |
| displayString | Assign a string value to a string identifier. |
| dynamicLoad | Dynamically load the DLL passed as argument. In query mode, return type is based on queried flag. |
| exportAll |
|
| exportAnim |
|
| exportAnimFromReference |
|
| exportAsReference |
|
| exportSelected |
|
| exportSelectedAnim |
|
| exportSelectedAnimFromReference |
|
| fcheck | Invokes the fcheck program to display images in a separate window. |
| feof | Reproduces the behavior of the mel command of the same name. |
| fileBrowserDialog | The fileBrowserDialog command offers more control of the windows file browser dialog. See the fileDialog command for cross platform file dialog support. |
| fileDialog | |
| finder | Create, Query, Edit a finder control. Each finder control has a drop icon pocket, an edit line and a history button. The argument defines the name of the finder control. In query mode, return type is based on queried flag. |
| flushUndo | Removes everything from the undo queue, freeing up memory. |
| fscanf | fscanf(inputFile, formatString) -> tuple |
| getFileList | Returns a list of files matching an optional wildcard pattern. |
| getInputDeviceRange | This command lists the minimum and maximum values the device axis can return. |
| getModifiers | This command returns the current state of the modifier keys. |
| getReferences | |
| hardware | Return description of the hardware available in the machine. |
| hitTest | The hitTestcommand hit-tests a point in the named control and returns a list of items underneath the point. The point is specified in pixels with the origin (0,0) at the top-left corner. This position is compatible with the coordinates provided by a drop-callback. The types of items that may be returned depends upon the specific control; not all controls currently support hit-testing. |
| imfPlugins | This command queries all the available imf plugins for its name, keyword or image file extension. |
| importFile |
|
| internalVar | This command returns the values of internal variables. |
| iterReferences | returns references in the scene as a list of value tuples. The values in the tuples can be namespaces, refNodes (as PyNodes), |
| launch | Launch the appropriate application to open the document specified. |
| launchImageEditor | Launch the appropriate application to edit/view the image files specified. |
| listDeviceAttachments | This command lists the current set of device attachments. |
| listInputDeviceAxes | This command lists all of the axes of the specified input device. |
| listInputDeviceButtons | This command lists all of the buttons of the specified input device specified as an argument. |
| listInputDevices | This command lists all input devices that maya knows about. |
| listNamespaces | Returns a list of the namespaces of referenced files. |
| listNamespaces_new | Returns a list of the namespaces in the scene |
| listReferences | Like iterReferences, except returns a list instead of an iterator. |
| loadPlugin | Load plug-ins into Maya. The parameter(s) to this command are either the names or pathnames of plug-in files. The convention for naming plug-ins is to use a .so extension on Linux, a .mll extension on Windows and .bundle extension on Mac OS X. MAYA_PLUG_IN_PATH will be searched looking for a file with the given name. If you specified the plug-in without an extension, the appropriate one for the platform will be automatically appended. When the plug-in is loaded, the name used in Maya’s internal plug-in registry for the plug-in information will be the file name with the extension removed. For example, if you load the plug-in newNode.mllthe name used in the Maya’s registry will be newNode. This value as well as that value with either a .so, .mllor .bundleextension can be used as valid arguments to either the unloadPlugin or pluginInfo commands. |
| loadReference |
|
| memory | Used to query essential statistics on memory availability and usage |
| mouse | This command allows to configure mouse. |
| namespace | This command allows a namespace to be created or set or removed. |
| namespaceInfo | This command displays information about the current namespace. |
| newFile |
|
| openFile |
|
| openGLExtension | Command returns the extension name depending on whether a given OpenGL extension is supported or not. The input is the extension string to the -extension flag. If the -extension flag is not used, or if the string argument to this flag is an empty string than all extension names are returned in a single string. If the extension exists it is not necessary true that the extension is supported. This command can only be used when a modeling view has been created. Otherwise no extensions will have been initialized and the resulting string will always be the empty string. |
| openMayaPref | Set or query API preferences. |
| pluginInfo | This command provides access to the plugin registry of the application. |
| preloadRefEd | This creates an editor for managing which references will be read in (loaded) and which deferred (unloaded) upon opening a file. |
| projFileViewer | This command creates a viewer that lists the project files in the current working directory. |
| recordAttr | This command sets up an attribute to be recorded. |
| redo | Takes the most recently undone command from the undo list and redoes it. |
| reference | Flags: |
| referenceEdit | Use this command to remove and change the modifications which have been applied to references. |
| referenceQuery | Use this command to find out information about references and referenced nodes. |
| rehash | Derived from mel command maya.cmds.rehash |
| reloadImage | This command reloads an xpm image from disk. |
| renameFile |
|
| requires | This command is used during file I/O to specify the requirements needed to load the given file. It defines what file format version was used to write the file, or what plug-ins are required to load the scene. The first string names a product (either maya, or a plug-in name) The second string gives the version. This command is only useful during file I/O, so users should not have any need to use this command themselves. |
| saveAs | |
| saveImage | This command creates a static image control for non-xpm files used to display a thumbnail image of the scene file. |
| sceneEditor | This creates an editor for managing the files in a scene. |
| sceneName |
|
| sceneUIReplacement | This command returns existing scene based UI that can be utilized by the scene that is being loaded. It can also delete any such UI that is not used by the loading scene. |
| scriptNode | scriptNodes contain scripts that are executed when a file is loaded or when the script node is deleted. The scriptNode command is used to create, edit, query, and test scriptNodes. In query mode, return type is based on queried flag. |
| selLoadSettings | This command is used to edit and query information about the implicit load settings. |
| setAttrMapping | This command applies an offset and scale to a specified device attachment. |
| setInputDeviceMapping | The command sets a scale and offset for all attachments made to a specified device axis. |
| showHelp | Invokes a web browser to open the on-line documentation and help files. |
| suspendReferenceUpdates | Original Arguments: (func) |
| sysFile | This command provides a system independent way to create a directory or to rename or delete a file. |
| timerX | Used to calculate elapsed time. |
| translator | Set or query parameters associated with the file translators specified in as the argument. |
| unassignInputDevice | This command deletes all command strings associated with this device. |
| undo | Takes the most recent command from the undo list and undoes it. |
| undoInfo | This command controls the undo/redo parameters. |
| unloadPlugin | Unload plug-ins from Maya. After the successful execution of this command, plug-in services will no longer be available. |
| FileInfo | store and get custom data specific to this file: |
| FileReference | A class for manipulating references which inherits Path and path. you can create an |
| Namespace | |
| Path | A basic Maya file class. it gets most of its power from the path class written by Jason Orendorff. |
| ReferenceCache | For the sake of speeding up the process of identifying File References in the scene |
| ReferenceEdit | Parses a reference edit command string into various components based on the edit type. |
| Translator | >>> ascii = Translator('mayaAscii')
|
| Workspace | This class is designed to lend more readability to the often confusing workspace command. |
| WorkspaceEntryDict | |
| path | path.py - An object representing a path to a file or directory. |