pymel.core.system.requires

requires(*args, **kwargs)

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. The flags -nodeTypeand -dataTypespecify the node types and data types defined by the plug-in. When Maya open a scene file, it runs requirescommand in the file and load required plug-ins. But some plug-ins may be not loaded because they are missing. The flags -nodeTypeand -dataTypeare used by the missing plug-ins. If one plug-in is missing, nodes and data created by this plug-in are created as unknown nodes and unknown data. Maya records their original types for these unknown nodes and data. When these nodes and data are saved back to file, it will be possible to determine the associated missing plug-ins. And when export selected nodes, Maya can write out the exact required plug-ins. The flags -nodeTypeand -dataTypeis optional. In this command, if these flags are not given for one plug-in and the plug-in is missing, the requirescommand of this plug-in will always be saved back.

Flags:

Long Name / Short Name Argument Types Properties
dataType / dt unicode ../../../_images/create.gif
  Specify a data type defined by this plug-in. The data type is specified by MFnPlugin::registerData() when register the plug-in.
nodeType / nt unicode ../../../_images/create.gif
  Specify a node type defined by this plug-in. The node type is specified by MFnPlugin::registerNode() when register the plug-in. Flag can have multiple arguments, passed either as a tuple or a list.

Derived from mel command maya.cmds.requires

Example:

import pymel.core as pm

pm.requires( 'maya', '7.0' )
pm.requires( 'simpleLoftNode.so', '1.0' )
pm.requires( 'gpuCache', '1.0', nodeType='gpuCache')