Python API 2.0 Reference
|
Public Member Functions | |
def | __init__ () |
def | addArg () |
def | addFlag () |
def | makeFlagMultiUse () |
def | makeFlagQueryWithFullArgs () |
def | maxObjects () |
def | minObjects () |
def | setMaxObjects () |
def | setMinObjects () |
def | setObjectType () |
def | useSelectionAsDefault () |
Static Public Member Functions | |
def | __new__ () |
Static Public Attributes | |
Argument Types | |
int | kAngle = 8 |
int | kBoolean = 2 |
int | kDistance = 7 |
int | kDouble = 4 |
int | kInvalidArgType = 0 |
int | kLastArgType = 11 |
int | kLong = 3 |
int | kNoArg = 1 |
int | kSelectionItem = 10 |
int | kString = 5 |
int | kTime = 9 |
int | kUnsigned = 6 |
Object Formats | |
int | kInvalidObjectFormat = 0 |
int | kLastObjectFormat = 4 |
int | kNone = 1 |
int | kSelectionList = 3 |
int | kStringObjects = 2 |
Properties | |
enableEdit = property(...) | |
enableQuery = property(...) | |
Syntax for commands.
Signature | Parameters | Description |
---|---|---|
MSyntax() | Default constructor. Returns a new, empty MSyntax object. | |
MSyntax(src) | src - MSyntax | Copy constructor. Returns a new MSyntax object with the same value as src. |
def OpenMaya.MSyntax.__init__ | ( | ) |
Initialize self. See help(type(self)) for accurate signature.
|
static |
Create and return a new object. See help(type) for accurate signature.
OpenMaya.MSyntax.addArg | ( | ) |
Add a command argument.
Signature: | addArg(argType) |
Parameters: | argType - Argument Type constant |
Returns: | Reference to self. |
Description: | Add a command argument. |
OpenMaya.MSyntax.addFlag | ( | ) |
Add a flag and its arguments.
Signature: | addFlag(shortName, longName, argTypes) |
Parameters: | shortName - string longName - string argTypes - Argument Type constant orsequence of Argument Type constants |
Returns: | Reference to self. |
Description: | Add a flag and its arguments. Raises TypeError if more than 6 argument types are provided. |
OpenMaya.MSyntax.makeFlagMultiUse | ( | ) |
Set whether a flag may be used multiple times on the command line.
Signature: | makeFlagMultiUse(flagName) |
Parameters: | flagName - string |
Returns: | Reference to self. |
Description: | Set whether a flag may be used multiple times on the command line. |
OpenMaya.MSyntax.makeFlagQueryWithFullArgs | ( | ) |
Set whether a flag requires its args when queried.
Signature: | makeFlagQueryWithFullArgs(flagName, argsOptional) |
Parameters: | flagName - string argsOptional - bool |
Returns: | Reference to self. |
Description: | Set whether a flag requires its args when queried. |
OpenMaya.MSyntax.maxObjects | ( | ) |
Returns the maximum number of objects which can be passed to the command.
Signature: | maxObjects() |
Parameters: | |
Returns: | int |
Description: | Returns the maximum number of objects which can be passed to the command. If no maximum has been set then the maximum will be unbounded and this method will return 0, which unfortunately is indistinguishable from the situation where the maximum has been set to 0. |
OpenMaya.MSyntax.minObjects | ( | ) |
Returns the minimum number of objects which can be passed to the command.
Signature: | minObjects() |
Parameters: | |
Returns: | int |
Description: | Returns the minimum number of objects which can be passed to the command. If no minimum has been set then the minimum will default to 0. |
OpenMaya.MSyntax.setMaxObjects | ( | ) |
Sets the maximum number of objects which can be passed to the command.
Signature: | setMaxObjects(max) |
Parameters: | max - int |
Returns: | Reference to self. |
Description: | Sets the maximum number of objects which can be passed to the command. If no maximum has been set then the maximum will be unbounded. Raises ValueError if max is negative. |
OpenMaya.MSyntax.setMinObjects | ( | ) |
Sets the minimum number of objects which can be passed to the command.
Signature: | setMinObjects(min) |
Parameters: | min - int |
Returns: | Reference to self. |
Description: | Sets the minimum number of objects which can be passed to the command. If no minimum has been set then the minimum will be 0. Raises ValueError if min is negative. |
OpenMaya.MSyntax.setObjectType | ( | ) |
Set the type and number of objects to be passed to the command.
Signature: | setObjectType(objType, min=0, max=None) |
Parameters: | objType - Object Format constant min - min # of objects max - max # of objects. |
Returns: | Reference to self. |
Description: | Set the type and number of objects to be passed to the command. Raises ValueError if min or max is negative, or if max is less than min. |
OpenMaya.MSyntax.useSelectionAsDefault | ( | ) |
If set to True then when no objects are provided on the command-line Maya will pass the current selection instead.
Signature: | useSelectionAsDefault(useSelection) |
Parameters: | useSelection - bool |
Returns: | Reference to self. |
Description: | If set to True then when no objects are provided on the command-line Maya will pass the current selection instead. Defaults to False. |
|
static |
Name: | kAngle |
Type: | int |
Description: |
|
static |
Name: | kBoolean |
Type: | int |
Description: |
|
static |
Name: | kDistance |
Type: | int |
Description: |
|
static |
Name: | kDouble |
Type: | int |
Description: |
|
static |
Name: | kInvalidArgType |
Type: | int |
Description: |
|
static |
Name: | kInvalidObjectFormat |
Type: | int |
Description: |
|
static |
Name: | kLastArgType |
Type: | int |
Description: |
|
static |
Name: | kLastObjectFormat |
Type: | int |
Description: |
|
static |
Name: | kLong |
Type: | int |
Description: |
|
static |
Name: | kNoArg |
Type: | int |
Description: |
|
static |
Name: | kNone |
Type: | int |
Description: |
|
static |
Name: | kSelectionItem |
Type: | int |
Description: |
|
static |
Name: | kSelectionList |
Type: | int |
Description: |
|
static |
Name: | kString |
Type: | int |
Description: |
|
static |
Name: | kStringObjects |
Type: | int |
Description: |
|
static |
Name: | kTime |
Type: | int |
Description: |
|
static |
Name: | kUnsigned |
Type: | int |
Description: |
|
static |
Enable support for the -edit flag.
Name: | enableEdit |
Type: | bool |
Access: | RW |
Description: | Enable support for the -edit flag. |
|
static |
Enable support for the -query flag.
Name: | enableQuery |
Type: | bool |
Access: | RW |
Description: | Enable support for the -query flag. |