Go to: Synopsis. Return value. Related. Flags. Python examples.
requires(
string string
, [dataType=string], [nodeType=string])
Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.
requires is undoable, NOT queryable, and NOT editable.
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.None
Long name (short name) | Argument types | Properties | ||
---|---|---|---|---|
dataType(dt)
|
string
|
|||
|
||||
nodeType(nt)
|
string
|
|||
|
Flag can appear in Create mode of command | Flag can appear in Edit mode of command |
Flag can appear in Query mode of command | Flag can have multiple arguments, passed either as a tuple or a list. |
import maya.cmds as cmds cmds.requires( 'maya', '7.0' ) cmds.requires( 'simpleLoftNode.so', '1.0' ) cmds.requires( 'gpuCache', '1.0', nodeType='gpuCache')