pymel.core.system

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() 
Path('...test.ma')

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 by Maya 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 Editor window or console.
convertUnit This command converts values between different units of measure.
crashInfo Provides an interface to the crash file information.
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.
dbfootprint This command lets you explore the memory usage of specific parts of the scene.
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.
dbpeek The dbpeekcommand is used to analyze the Maya data for information of interest.
dbtrace The dbtracecommand is used to manipulate trace objects.
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 plain text.
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.
dgfilter The dgfiltercommand is used to define Dependency Graph filters that select DG objects based on certain criteria.
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.
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 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.
fileDialog The fileBrowserDialog and fileDialog commands have now been deprecated.
fileDialog2 This command provides a dialog that allows users to select files or directories.
filePathEditor Maya can reference and use external files, such as textures or other Maya scenes.
findType The findTypecommand is used to search through a dependency subgraph on a certain node to find all nodes of the given type.
flushUndo Removes everything from the undo queue, freeing up memory.
fscanf Scans inputFile for formats specified in the formatString.
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.
getModulePath Returns the module path for a given module name.
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.
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.
isModified
iterReferences returns references in the scene as a list of value tuples.
launch Launch the appropriate application to open the document, web page or directory 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 Returns a list of the namespaces of referenced files.
listReferences Like iterReferences, except returns a list instead of an iterator.
loadModule Maya plug-ins may be installed individually within one of Maya’s standard plug-in directories, or they may be packaged up with other resources in a module.
loadPlugin Load plug-ins into Maya.
loadReference This flag loads a file and associates it with the passed reference node.
melInfo This command returns the names of all global MEL procedures that are currently defined as a string array.
memory Used to query essential statistics on memory availability and usage.
moduleInfo Returns information on modules found by Maya.
mouse This command allows to configure mouse.
namespace This command allows a namespace to be created, set or removed.
namespaceInfo This command displays information about a namespace.
newFile Initialize the scene.
ogs OGS is one of the viewport renderers.
openFile Open the specified file.
openGLExtension Command returns the extension name depending on whether a given OpenGL extension is supported or not.
openMayaPref Set or query API preferences.
pluginDisplayFilter Register, deregister or query a plugin display filter.
pluginInfo This command provides access to the plug-in 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.
profiler The profiler is used to record timing information from key events within Maya, as an aid in tuning the performance of scenes, scripts and plug-ins.
profilerTool This script is intended to be used by the profilerPanel to interact with the profiler tool’s view (draw region).
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.
saveAs
saveFile Save the specified file.
saveImage This command creates a static image for non-xpm files.
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.
scriptNode scriptNodes contain scripts that are executed when a file is loaded or when the script node is deleted. If a script
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.
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.
unknownNode Allows querying of the data stored for unknown nodes (nodes that are defined by a plug-in that Maya could not load when loading a scene file).
unknownPlugin Allows querying of the unknown plug-ins used by the scene, and provides a means to remove them.
unloadPlugin Unload plug-ins from Maya.
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.
whatsNewHighlight This command is used to toggle the What’s New highlighting feature, and the display of the settings dialog for the feature that appears on startup.
xpmPicker Open a dialog and ask you to choose a xpm file

Classes

FileInfo store and get custom data specific to this file:
FileReference A class for manipulating references which inherits Path and path.
Namespace
Path A basic Maya file class.
ReferenceEdit Parses a reference edit command string into various components based on the edit type.
Translator Provides information about a Maya translator, which is used for reading and/or writing file formats.
UndoChunk Context manager for encapsulating code in a single undo.
Workspace This class is designed to lend more readability to the often confusing workspace command.
WorkspaceEntryDict
pathClass alias of path