pymel.core.datatypes.Matrix¶
digraph inheritance3cc9bec1b9 { rankdir=TB; ranksep=0.15; nodesep=0.15; size="8.0, 12.0"; "Array" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",URL="../pymel.util.arrays/pymel.util.arrays.Array.html#pymel.util.arrays.Array",style="setlinewidth(0.5)",tooltip="A generic n-dimensional array class using nested lists for storage.",height=0.25,shape=box,fontsize=8]; "MMatrix" [shape=box,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=8,style="setlinewidth(0.5)",height=0.25]; "Matrix" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",URL="#pymel.core.datatypes.Matrix",style="setlinewidth(0.5)",tooltip="A 4x4 transformation matrix based on api Matrix",height=0.25,shape=box,fontsize=8]; "MatrixN" -> "Matrix" [arrowsize=0.5,style="setlinewidth(0.5)"]; "MMatrix" -> "Matrix" [arrowsize=0.5,style="setlinewidth(0.5)"]; "MatrixN" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",URL="../pymel.util.arrays/pymel.util.arrays.MatrixN.html#pymel.util.arrays.MatrixN",style="setlinewidth(0.5)",tooltip="A generic size MatrixN class, basically a 2 dimensional Array.",height=0.25,shape=box,fontsize=8]; "Array" -> "MatrixN" [arrowsize=0.5,style="setlinewidth(0.5)"]; }
- class Matrix(*args, **kwargs)¶
A 4x4 transformation matrix based on api Matrix
>>> from pymel.all import * >>> import pymel.core.datatypes as dt >>> >>> i = dt.Matrix() >>> print i.formated() [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]]
>>> v = dt.Matrix(1, 2, 3) >>> print v.formated() [[1.0, 2.0, 3.0, 0.0], [1.0, 2.0, 3.0, 0.0], [1.0, 2.0, 3.0, 0.0], [1.0, 2.0, 3.0, 0.0]]
- __add__(other)¶
m.__add__(v) <==> m+v Returns the result of the addition of m and v if v is convertible to a MatrixN (element-wise addition), adds v to every component of m if v is a scalar
- __delitem__(index)¶
Cannot delete from a class with a fixed shape
- __eq__(other)¶
m.__eq__(v) <==> m == v Equivalence test
- __getitem__(index)¶
m.__getitem__(index) <==> m[index] Get component index value from self. index can be a single numeric value or slice, thus one or more rows will be returned, or a row,column tuple of numeric values / slices
- __iadd__(other)¶
m.__iadd__(v) <==> m += v In place addition of m and v, see __add__
- __imul__(other)¶
m.__imul__(n) <==> m *= n Valid for Matrix * Matrix multiplication, in place multiplication of MatrixN m by MatrixN n
- __isub__(other)¶
m.__isub__(v) <==> m -= v In place substraction of m and v, see __sub__
- __iter__(*args, **kwargs)¶
Iterate on the Matrix rows
- __len__()¶
Number of components in the Matrix instance
- __melobject__()¶
Special method for returning a mel-friendly representation. In this case, a flat list of 16 values
- __mul__(other)¶
m.__mul__(x) <==> m*x If x is a MatrixN, __mul__ is mapped to matrix multiplication m*x, if x is a VectorN, to MatrixN by VectorN multiplication. Otherwise, returns the result of the element wise multiplication of m and x if x is convertible to Array, multiplies every component of b by x if x is a single numeric value
- __ne__(other)¶
m.__ne__(v) <==> m != v Equivalence test
- __neg__()¶
m.__neg__() <==> -m The unary minus operator. Negates the value of each of the components of m
- __radd__(other)¶
m.__radd__(v) <==> v+m Returns the result of the addition of m and v if v is convertible to a MatrixN (element-wise addition), adds v to every component of m if v is a scalar
- __rmul__(other)¶
m.__rmul__(x) <==> x*m If x is a MatrixN, __rmul__ is mapped to matrix multiplication x*m, if x is a VectorN (or Vector or Point or Color), to transformation, ie VectorN by MatrixN multiplication. Otherwise, returns the result of the element wise multiplication of m and x if x is convertible to Array, multiplies every component of m by x if x is a single numeric value
- __rsub__(other)¶
m.__rsub__(v) <==> v-m Returns the result of the substraction of m from v if v is convertible to a MatrixN (element-wise substration), replace every component c of m by v-c if v is a scalar
- __setitem__(index, value)¶
m.__setitem__(index, value) <==> m[index] = value Set value of component index on self index can be a single numeric value or slice, thus one or more rows will be returned, or a row,column tuple of numeric values / slices
- __sub__(other)¶
m.__sub__(v) <==> m-v Returns the result of the substraction of v from m if v is convertible to a MatrixN (element-wise substration), substract v to every component of m if v is a scalar
- a00¶
- a01¶
- a02¶
- a03¶
- a10¶
- a11¶
- a12¶
- a13¶
- a20¶
- a21¶
- a22¶
- a23¶
- a30¶
- a31¶
- a32¶
- a33¶
- adjoint()¶
Returns the adjoint (adjugate) Matrix
- apicls¶
alias of MMatrix
- asMatrix(percent=None)¶
The matrix representation for this Matrix/TransformationMatrix/Quaternion/EulerRotation instance
- assign(value)¶
- blend(other, weight=0.5)¶
Returns a 0.0-1.0 scalar weight blend between self and other Matrix, blend mixes Matrix as transformation matrices
- cnames = ('a00', 'a01', 'a02', 'a03', 'a10', 'a11', 'a12', 'a13', 'a20', 'a21', 'a22', 'a23', 'a30', 'a31', 'a32', 'a33')¶
- data¶
The Matrix/FloatMatrix/TransformationMatrix/Quaternion/EulerRotation data
- det()¶
Returns the determinant of this Matrix instance
- det3x3()¶
Returns the determinant of the upper left 3x3 submatrix of this Matrix instance, it’s the same as doing det(m[0:3, 0:3])
- det4x4()¶
Returns the 4x4 determinant of this Matrix instance
- get()¶
Wrap the Matrix api get method
- homogenize()¶
Returns a homogenized version of the Matrix
- identity = Matrix([[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]])¶
- inverse()¶
Returns the inverse Matrix
- isEquivalent(other, tol=1e-10)¶
Returns true if both arguments considered as Matrix are equal within the specified tolerance
- isSingular()¶
Returns True if the given Matrix is singular
- matrix¶
The Matrix representation for this Matrix/TransformationMatrix/Quaternion/EulerRotation instance
- ndim = 2¶
- rotate¶
The rotation expressed in this Matrix, in transform space
- scale¶
The scale expressed in this Matrix, in transform space
- setToIdentity()¶
m.setToIdentity() <==> m = a * b Sets MatrixN to the identity matrix
- setToProduct(left, right)¶
m.setToProduct(a, b) <==> m = a * b Sets MatrixN to the result of the product of MatrixN a and MatrixN b
- shape = (4, 4)¶
- size = 16¶
- translate¶
The translation expressed in this Matrix, in transform space
- transpose()¶
Returns the transposed Matrix
- weighted(weight)¶
Returns a 0.0-1.0 scalar weighted blend between identity and self