OpenMaya.MSyntax Class Reference

Class Description

Syntax for commands.

Constructors

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.

 


+ Inheritance diagram for OpenMaya.MSyntax:

Public Member Functions

__init__ ()
 
addArg ()
 
addFlag ()
 
makeFlagMultiUse ()
 
makeFlagQueryWithFullArgs ()
 
maxObjects ()
 
minObjects ()
 
setMaxObjects ()
 
setMinObjects ()
 
setObjectType ()
 
useSelectionAsDefault ()
 

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
 
 enableQuery
 

Constructor & Destructor Documentation

OpenMaya.MSyntax.__init__ ( )
x.__init__(...) initializes x; see help(type(x)) for signature

Member Function Documentation

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.

Member Data Documentation

OpenMaya.MSyntax.kAngle = 8
static
Name: kAngle
Type: int
Description:
OpenMaya.MSyntax.kBoolean = 2
static
Name: kBoolean
Type: int
Description:
OpenMaya.MSyntax.kDistance = 7
static
Name: kDistance
Type: int
Description:
OpenMaya.MSyntax.kDouble = 4
static
Name: kDouble
Type: int
Description:
OpenMaya.MSyntax.kInvalidArgType = 0
static
Name: kInvalidArgType
Type: int
Description:
OpenMaya.MSyntax.kInvalidObjectFormat = 0
static
Name: kInvalidObjectFormat
Type: int
Description:
OpenMaya.MSyntax.kLastArgType = 11
static
Name: kLastArgType
Type: int
Description:
OpenMaya.MSyntax.kLastObjectFormat = 4
static
Name: kLastObjectFormat
Type: int
Description:
OpenMaya.MSyntax.kLong = 3
static
Name: kLong
Type: int
Description:
OpenMaya.MSyntax.kNoArg = 1
static
Name: kNoArg
Type: int
Description:
OpenMaya.MSyntax.kNone = 1
static
Name: kNone
Type: int
Description:
OpenMaya.MSyntax.kSelectionItem = 10
static
Name: kSelectionItem
Type: int
Description:
OpenMaya.MSyntax.kSelectionList = 3
static
Name: kSelectionList
Type: int
Description:
OpenMaya.MSyntax.kString = 5
static
Name: kString
Type: int
Description:
OpenMaya.MSyntax.kStringObjects = 2
static
Name: kStringObjects
Type: int
Description:
OpenMaya.MSyntax.kTime = 9
static
Name: kTime
Type: int
Description:
OpenMaya.MSyntax.kUnsigned = 6
static
Name: kUnsigned
Type: int
Description:

Property Documentation

OpenMaya.MSyntax.enableEdit
static
 Enable support for the -edit flag.
Name: enableEdit
Type: bool
Access: RW
Description: Enable support for the -edit flag.
OpenMaya.MSyntax.enableQuery
static
 Enable support for the -query flag.
Name: enableQuery
Type: bool
Access: RW
Description: Enable support for the -query flag.