Python API 2.0 Reference: OpenMaya.MArgList Class Reference

+ Inheritance diagram for OpenMaya.MArgList:

Public Member Functions

__init__ ()
 
__len__ ()
 
Available in Maya 2012 Gold:
addArg ()
 
asBool ()
 
asFloat ()
 
asInt ()
 
asIntArray ()
 
asString ()
 
asStringArray ()
 
flagIndex ()
 
lastArgUsed ()
 
Available in Maya 2012 HotFix 1:
asAngle ()
 
asDistance ()
 
asDouble ()
 
asDoubleArray ()
 
asMatrix ()
 
asPoint ()
 
asTime ()
 
asVector ()
 

Static Public Attributes

int kInvalidArgIndex = -1
 

Detailed Description

Argument list for passing to commands.

Constructors

Signature Parameters Description
MArgList()  

Default constructor. Returns a new, empty MArgList object.

MArgList(src) src - MArgList

Copy constructor. Returns a new MArgList object with the same args as src.

Sequence Support

Supports the length() function, which returns the number of arguments in the list.

 


Constructor & Destructor Documentation

OpenMaya.MArgList.__init__ ( )
x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Member Function Documentation

OpenMaya.MArgList.__len__ ( )
x.__len__() <==> len(x)
OpenMaya.MArgList.addArg ( )
addArg(arg) -> self , 'arg' is a numeric value, MAngle, MDistance,
MTime, MPoint or        MVector.

Add an argument to the end of the arg list.
Signature: addArg(value)
Parameters: arg - bool, int, float, string, MAngle, MDistance, MPoint, MTime or MVector
Returns:
Description: Add an argument to the end of the arg list.
OpenMaya.MArgList.asAngle ( )
asAngle(index) -> MAngle

Return an argument as an MAngle.
Signature: asAngle(index)
Parameters: index - int
Returns: MAngle
Description: Return an argument as an MAngle. IndexError will be raised if index is out of bounds.
OpenMaya.MArgList.asBool ( )
asBool(index) -> bool

Return an argument as a boolean.
Signature: asBool(index)
Parameters: index - int
Returns: bool
Description: Return an argument as a boolean. IndexError will be raised if index is out of bounds.
OpenMaya.MArgList.asDistance ( )
asDistance(index) -> MDistance

Return an argument as an MDistance.
Signature: asDistance(index)
Parameters: index - int
Returns: MDistance
Description: Return an argument as an MDistance. IndexError will be raised if index is out of bounds.
OpenMaya.MArgList.asDouble ( )
asDouble(index) -> float

Alias for asFloat().
Signature: asDouble(index)
Parameters: index - int
Returns: float
Description: Alias for asFloat().
OpenMaya.MArgList.asDoubleArray ( )
asDoubleArray(index) -> MDoubleArray

Return a sequence of arguments as an MDoubleArray.
Signature: asDoubleArray(index)
Parameters: index - int
Returns: MDoubleArray
Description: Return a sequence of arguments as an MDoubleArray. IndexError will be raised if index is out of bounds.
OpenMaya.MArgList.asFloat ( )
asFloat(index) -> float

Return an argument as a float.
Signature: asFloat(index)
Parameters: index - int
Returns: float
Description: Return an argument as a float. IndexError will be raised if index is out of bounds.
OpenMaya.MArgList.asInt ( )
asInt(index) -> int

Return an argument as an integer.
Signature: asInt(index)
Parameters: index - int
Returns: int
Description: Return an argument as an integer. IndexError will be raised if index is out of bounds.
OpenMaya.MArgList.asIntArray ( )
asIntArray(index) -> MIntArray

Return a sequence of arguments as an MIntArray.
Signature: asIntArray(index)
Parameters: index - int
Returns: MIntArray
Description: Return a sequence of arguments as an MIntArray. IndexError will be raised if index is out of bounds.
OpenMaya.MArgList.asMatrix ( )
asMatrix(index) -> MMatrix

Return a sequence of arguments as an MMatrix.
Signature: asMatrix(index)
Parameters: index - int
Returns: MMatrix
Description: Return a sequence of arguments as an MMatrix. IndexError will be raised if index is out of bounds.
OpenMaya.MArgList.asPoint ( )
asPoint(index) -> MPoint

Return a sequence of arguments as an MPoint.
Signature: asPoint(index, numElements=3)
Parameters: index - int<br>
numElements - int
Returns: MPoint
Description: Return a sequence of arguments as an MPoint. ValueError will be raised if numElements is greater than 4 as that is the maximum dimension for an MPoint. IndexError will be raised if index is out of bounds
OpenMaya.MArgList.asString ( )
asString(index) -> string

Return an argument as a string.
Signature: asString(index)
Parameters: index - int
Returns: string
Description: Return an argument as a string. IndexError will be raised if index is out of bounds.
OpenMaya.MArgList.asStringArray ( )
asStringArray(index) -> list of strings

Return a sequence of arguments as a list of strings.
Signature: asStringArray(index)
Parameters: index - int
Returns: list of strings
Description: Return a sequence of arguments as a list of strings. IndexError will be raised if index is out of bounds.
OpenMaya.MArgList.asTime ( )
asTime(index) -> MTime

Return an argument as an MTime.
Signature: asTime(index)
Parameters: index - int
Returns: MTime
Description: Return an argument as an MTime. IndexError will be raised if index is out of bounds.
OpenMaya.MArgList.asVector ( )
asVector(index) -> MVector

Return a sequence of arguments as an MVector.
Signature: asVector(index, numElements=3)
Parameters: index - int

numElements - int
Returns: MVector
Description: Return a sequence of arguments as an MVector. ValueError will be raised if numElements is greater than 3 as that is the maximum dimension for an MVector. IndexError will be raised if index is out of bounds.
OpenMaya.MArgList.flagIndex ( )
flagIndex(shortFlag, longFlag=None) -> int

Return index of first occurrence of specified flag.
Signature: flagIndex(shortName, longName=None)
Parameters: shortName - string
longName - string
Returns: int
Description: Return the index of the first occurrence of the specified flag or kInvalidFlagIndex if the flag is not in the arg list.
OpenMaya.MArgList.lastArgUsed ( )
lastArgUsed() -> int

Return index of last argument used by the most recent as*() method.
Signature: lastArgUsed()
Parameters:
Returns: int
Description: Return the index of the last argument used by the most recent as*() method call, or -1 if no arguments have been used yet.

Member Data Documentation

OpenMaya.MArgList.kInvalidArgIndex = -1
static
Name: kInvalidArgIndex
Type: int
Description: Used by the flagIndex() method to indicate that the flag was not found.