Python API 2.0 Reference
OpenMaya.MMatrix Class Reference
+ Inheritance diagram for OpenMaya.MMatrix:

Public Member Functions

def __add__ ()
 
def __delitem__ ()
 
def __eq__ ()
 
def __ge__ ()
 
def __getitem__ ()
 
def __gt__ ()
 
def __iadd__ ()
 
def __imul__ ()
 
def __init__ ()
 
def __isub__ ()
 
def __le__ ()
 
def __len__ ()
 
def __lt__ ()
 
def __mul__ ()
 
def __ne__ ()
 
def __radd__ ()
 
def __repr__ ()
 
def __rmul__ ()
 
def __rsub__ ()
 
def __setitem__ ()
 
def __str__ ()
 
def __sub__ ()
 
def adjoint ()
 
def det3x3 ()
 
def det4x4 ()
 
def getElement ()
 
def homogenize ()
 
def inverse ()
 
def isEquivalent ()
 
def isSingular ()
 
def setElement ()
 
def setToIdentity ()
 
def setToProduct ()
 
def transpose ()
 

Static Public Member Functions

def __new__ ()
 

Static Public Attributes

tuple kIdentity = maya.api.OpenMaya.MMatrix(((1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 0, 1)))
 
int kTolerance = 1
 

Detailed Description

4x4 matrix with double-precision elements.

Constructors

SignatureParametersDescription
MMatrix()  

Default constructor. Returns a new matrix set to the identity matrix.

MMatrix(src) src - MMatrix

Copy constructor. Returns a new matrix with the same value as src.

MMatrix(values) values - sequence of 16 float values or four tuples of four float values each.

Returns a new matrix whose elements are set to those given by values. Values are interpreted in row order, so the first four values make up the first row of the matrix, the second four values the second row of the matrix, and so on.

Sequence Support

An MMatrix object is treated like a sequence of 16 float values, in row major order. Element assignment is supported.

len() returns 16.

Deletion, concatenation, repetition and slicing are not supported.

Number Support

OperationResult
MMatrix + MMatrix

Returns a new matrix which is the sum of the two matrices.

MMatrix += MMatrix

Adds the second matrix to the first and returns a new reference to the first.

MMatrix - MMatrix

Returns a new matrix which is the result of subtracting the second matrix from the first.

MMatrix -= MMatrix

Subtracts the second matrix from the first and returns a new reference to the first.

MMatrix * MMatrix

Returns a new matrix which is the product of the two matrices.

MMatrix *= MMatrix

Multiplies the first matrix by the second and returns a new reference to the first.

MMatrix * float

Returns a new matrix in which all of the elements of the given matrix have been multiplied by the given float.

float * MMatrix

Returns a new matrix in which all of the elements of the given matrix have been multiplied by the given float.

MMatrix *= float

Multiplies all the elements of the matrix by the float and returns a new reference to the matrix.

Comparison Support

MMatrix == MMatrix Exact equality test. True if each of the 16 elements of the first matrix is exactly equal to the corresponding element in the second matrix. No tolerance is applied.
MMatrix != MMatrix Exact inequality test. True if any of the 16 elements in the first matrix is not exactly equal to the corresponding element in the second matrix. No tolerance is applied.

All other comparison operators will raise a TypeError exception.

 


Constructor & Destructor Documentation

def OpenMaya.MMatrix.__init__ ( )
Initialize self.  See help(type(self)) for accurate signature.

Member Function Documentation

def OpenMaya.MMatrix.__add__ ( )
Return self+value.
def OpenMaya.MMatrix.__delitem__ ( )
Delete self[key].
def OpenMaya.MMatrix.__eq__ ( )
Return self==value.
def OpenMaya.MMatrix.__ge__ ( )
Return self>=value.
def OpenMaya.MMatrix.__getitem__ ( )
Return self[key].
def OpenMaya.MMatrix.__gt__ ( )
Return self>value.
def OpenMaya.MMatrix.__iadd__ ( )
Return self+=value.
def OpenMaya.MMatrix.__imul__ ( )
Return self*=value.
def OpenMaya.MMatrix.__isub__ ( )
Return self-=value.
def OpenMaya.MMatrix.__le__ ( )
Return self<=value.
def OpenMaya.MMatrix.__len__ ( )
Return len(self).
def OpenMaya.MMatrix.__lt__ ( )
Return self<value.
def OpenMaya.MMatrix.__mul__ ( )
Return self*value.
def OpenMaya.MMatrix.__ne__ ( )
Return self!=value.
def OpenMaya.MMatrix.__new__ ( )
static
Create and return a new object.  See help(type) for accurate signature.
def OpenMaya.MMatrix.__radd__ ( )
Return value+self.
def OpenMaya.MMatrix.__repr__ ( )
Return repr(self).
def OpenMaya.MMatrix.__rmul__ ( )
Return value*self.
def OpenMaya.MMatrix.__rsub__ ( )
Return value-self.
def OpenMaya.MMatrix.__setitem__ ( )
Set self[key] to value.
def OpenMaya.MMatrix.__str__ ( )
Return str(self).
def OpenMaya.MMatrix.__sub__ ( )
Return self-value.
OpenMaya.MMatrix.adjoint ( )
Returns a new matrix containing this matrix's adjoint.
Signature: adjoint()
Parameters:  
Returns: MMatrix
Description: Returns a new matrix containing this matrix's adjoint.
OpenMaya.MMatrix.det3x3 ( )
Returns the determinant of the 3x3 matrix formed by the first 3 elements of the first 3 rows of this matrix.
Signature: det3x3()
Parameters:  
Returns: float
Description: Returns the determinant of the 3x3 matrix formed by the first 3 elements of the first 3 rows of this matrix.
OpenMaya.MMatrix.det4x4 ( )
Returns this matrix's determinant.
Signature: det4x4()
Parameters:  
Returns: float
Description: Returns this matrix's determinant.
OpenMaya.MMatrix.getElement ( )
Returns the matrix element for the specified row and column.
Signature: getElement(row,col)
Parameters: row - int
col - int
Returns: float
Description: Returns the matrix element specified by row and col. For retrieving single elements this is faster than indexing into the matrix as a sequence because it does not require the creation of an entire row tuple simply to retrieve one element from that row.
OpenMaya.MMatrix.homogenize ( )
Returns a new matrix containing the homogenized version of this matrix.
Signature: homogenize()
Parameters:  
Returns: MMatrix
Description: Returns a new matrix containing the homogenized version of this matrix.
OpenMaya.MMatrix.inverse ( )
Returns a new matrix containing this matrix's inverse.
Signature: inverse()
Parameters:  
Returns: MMatrix
Description: Returns a new matrix containing this matrix's nverse.
OpenMaya.MMatrix.isEquivalent ( )
Test for equivalence of two matrices, within a tolerance.
Signature: isEquivalent(other, tolerance=kTolerance)
Parameters: other - MMatrix
tolerance - float
Returns: bool
Description: Inexact equality test. Returns True if each element of this matrix is within tolerance of the corresponding element of other.
OpenMaya.MMatrix.isSingular ( )
Returns True if this matrix is singular.
Signature: isSingular()
Parameters:  
Returns: bool
Description: Returns True if this matrix is singular.
OpenMaya.MMatrix.setElement ( )
Sets the matrix element for the specified row and column.
Signature: setElement(row,col,value)
Parameters: row - int
col - int
value - float
Returns: New reference to self.
Description: Set the matrix element specified by row and col to the given value.
OpenMaya.MMatrix.setToIdentity ( )
Sets this matrix to the identity.
Signature: setToIdentity()
Parameters:  
Returns: New reference to self.
Description: Sets this matrix to the identity.
OpenMaya.MMatrix.setToProduct ( )
Sets this matrix to the product of the two matrices passed in.
Signature: setToProduct(left, right)
Parameters: left - MMatrix
right - MMatrix
Returns: New reference to self.
Description: Sets this matrix to the product of left and right.
OpenMaya.MMatrix.transpose ( )
Returns a new matrix containing this matrix's transpose.
Signature: transpose()
Parameters:  
Returns: MMatrix
Description: Returns a new matrix containing this matrix's transpose.

Member Data Documentation

OpenMaya.MMatrix.kIdentity = maya.api.OpenMaya.MMatrix(((1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 0, 1)))
static
Name: kIdentity
Type: MMatrix
Description: Identity matrix.
OpenMaya.MMatrix.kTolerance = 1
static
Name: kTolerance
Type: float
Description: Default tolerance for non-exact equality tests.