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 “-nodeType” and “-dataType” specify the node types and data types defined by the plug-in. When Maya open a scene file, it runs “requires” command in the file and load required plug-ins. But some plug-ins may be not loaded because they are missing. The flags “-nodeType” and “-dataType” are 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 “-nodeType” and “-dataType” is optional. In this command, if these flags are not given for one plug-in and the plug-in is missing, the “requires” command of this plug-in will always be saved back.
Long name (short name) | Argument Types | Properties | |
---|---|---|---|
dataType (dt) | unicode | ||
Specify a data type defined by this plug-in. The data type is specified by MFnPlugin::registerData() when register the plug-in.Flag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list. |
|||
nodeType (nt) | unicode | ||
|
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')