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:
>>> res = cmds.file( 'test.ma', exportAll=1, preserveReferences=1, type='mayaAscii', force=1 )
you can do this:
>>> expFile = exportAll( 'test.ma', preserveReferences=1, force=1)
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
>>> ref = createReference( expFile )
>>> ref
FileReference(u'.../test.ma', refnode=u'testRN')
Notice that the ‘type’ flag is set automatically for you when your path includes a ‘.mb’ or ‘.ma’ extension.
Paths returned by these commands are either a Path or a FileReference, so you can use object-oriented path methods with the results:
>>> expFile.exists()
True
>>> expFile.remove() # cleanup
Functions
aaf2fcp | This command is used to convert an aff file to a Final Cut Pro (fcp) xml file The conversion process can take several |
allNodeTypes | This command returns a list containing the type names of every kind of creatable node registered with the system. |
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. |
audioTrack | This command is used for inserting and removing tracks related to the audio clips displayed in the sequencer. |
autoSave | Provides an interface to the auto-save mechanism. |
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 |
convertUnit | This command converts values between different units of measure. |
createReference | Create a reference to the specified file. |
dagObjectCompare | dagObjectCompare can be used to compare to compare objects based on: type - Currently supports transform nodes and |
date | Returns information about current time and date. |
dbcount | The dbcountcommand is used to print and manage a list of statistics collected for counting operations. |
dbmessage | The dbmessagecommand is used to install monitors for certain message types, dumping debug information as they are sent so that the flow of messages can be examined. |
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 command is now obsolete. |
dgInfo | This command prints information about the DG in a text-oriented manner. The scope of the information printed is the |
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. |
dgmodified | The dgmodifiedcommand is used to find out which nodes in the dependency graph have been modified. |
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). |
displayError | |
displayInfo | |
displayString | Assign a string value to a string identifier. |
displayWarning | |
dynamicLoad | Dynamically load the DLL passed as argument. In query mode, return type is based on queried flag. |
error | The error command is provided so that the user can issue error messages from his/her scripts and control execution in the event of runtime errors. |
exportAll | Export everything into a single file. |
exportAnim | Export all animation nodes and animation helper nodes from all objects in the scene. |
exportAnimFromReference | Export the main scene animation nodes and animation helper nodes from all referenced objects. |
exportAsReference | Export the selected objects into a reference file with the given name. |
exportEdits | Use this command to export edits made in the scene to a separate file. |
exportSelected | Export the selected items into the specified file. |
exportSelectedAnim | Export all animation nodes and animation helper nodes from the selected objects in the scene. |
exportSelectedAnimFromReference | Export the main scene animation nodes and animation helper nodes from the selected referenced objects. |
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 and fileDialog commands have now been deprecated. Both commands are still callable, but it is |
fileDialog | The fileBrowserDialog and fileDialog commands have now been deprecated. Both commands are still callable, but it is |
fileDialog2 | This command provides a dialog that allows users to select files or directories. |
findType | The findTypecommand is used to search upstream through a dependency subgraph on a certain node to find all nodes of the |
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 |
imfPlugins | This command queries all the available imf plugins for its name, keyword or image file extension. |
importFile | Import the specified file. |
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 in the scene |
listNamespaces_old | Deprecated |
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 |
loadReference | This flag loads a file and associates it with the passed reference node. |
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 | Initialize the scene. |
ogs | OGS is one of the viewport renderers. As there is a lot of effort involved in migrating functionality it will evolve |
openFile | Open the specified file. |
openGLExtension | Command returns the extension name depending on whether a given OpenGL extension is supported or not. The input is the |
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 | Rename the scene. |
requires | This command is used during file I/O to specify the requirements needed to load the given file. It defines what file |
saveAs | |
saveFile | Save the specified file. |
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 | return the name of the current scene. |
sceneUIReplacement | This command returns existing scene based UI that can be utilized by the scene that is being loaded. It can also delete |
scriptNode | scriptNodes contain scripts that are executed when a file is loaded or when the script node is deleted. The scriptNode |
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. |
shotTrack | This command is used for inserting and removing tracks related to the shots displayed in the Sequencer. It can also be |
showHelp | Invokes a web browser to open the on-line documentation and help files. |
sysFile | This command provides a system independent way to create a directory or to rename or delete a file. |
timer | Allow simple timing of scripts and commands. |
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. |
untitledFileName | Obtain the base filename used for untitled scenes. |
warning | The warning command is provided so that the user can issue warning messages from his/her scripts. |
Classes
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. |
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 | |
pathClass |