pymel.core.datatypes.TransformationMatrix¶
- class TransformationMatrix(*args, **kwargs)¶
- RotationOrder = Enum( EnumValue('RotationOrder', 0, 'invalid'), EnumValue('RotationOrder', 1, 'XYZ'), EnumValue('RotationOrder', 2, 'YZX'), EnumValue('RotationOrder', 3, 'ZXY'), EnumValue('RotationOrder', 4, 'XZY'), EnumValue('RotationOrder', 5, 'YXZ'), EnumValue('RotationOrder', 6, 'ZYX'), EnumValue('RotationOrder', 7, 'last'))¶
- a00¶
- a01¶
- a02¶
- a03¶
- a10¶
- a11¶
- a12¶
- a13¶
- a20¶
- a21¶
- a22¶
- a23¶
- a30¶
- a31¶
- a32¶
- a33¶
- addRotation(rot, order, space)¶
Add to the rotation component by rotating relative to the existing transformation. The only valid transformation spaces for this method are MSpace::kTransform and MSpace::kPreTransform . All other spaces are treated as being equivalent to MSpace::kTransform .
Parameters: - rot : (float, float, float)
relative value to rotate by
- order : TransformationMatrix.RotationOrder
order in which to apply the rotation components
values: ‘XYZ’, ‘YZX’, ‘ZXY’, ‘XZY’, ‘YXZ’, ‘ZYX’
- space : Space.Space
transform space in which to perform the rotation
values: ‘transform’, ‘preTransform’, ‘object’, ‘world’
Derived from api method maya.OpenMaya.MSpace.addRotation
Undo is not currently supported for this method
- addRotationQuaternion(x, y, z, w, space)¶
Add to the rotation component by rotating relative to the existing transformation. Rotation is a quaternion. The only valid transformation spaces for this method are MSpace::kTransform and MSpace::kPreTransform . All other spaces are treated as being equivalent to MSpace::kTransform .
Parameters: - x : float
x component of quaternion
- y : float
y component of quaternion
- z : float
z component of quaternion
- w : float
w component of quaternion
- space : Space.Space
transformation space in which to perform the operation
values: ‘transform’, ‘preTransform’, ‘object’, ‘world’
Derived from api method maya.OpenMaya.MSpace.addRotationQuaternion
Undo is not currently supported for this method
- addScale(scale, space)¶
Add to the scale component by scaling relative to the existing transformation.
Parameters: - scale : (float, float, float)
relative value to scale by
- space : Space.Space
transform space in which to perform the scale
values: ‘transform’, ‘preTransform’, ‘object’, ‘world’
Derived from api method maya.OpenMaya.MSpace.addScale
Undo is not currently supported for this method
- addShear(shear, space)¶
Add to the shear component by shearing relative to the existing transformation.
Parameters: - shear : (float, float, float)
relative value to shear by
- space : Space.Space
transform space in which to perform the shear
values: ‘transform’, ‘preTransform’, ‘object’, ‘world’
Derived from api method maya.OpenMaya.MSpace.addShear
Undo is not currently supported for this method
- addTranslation(vector, space)¶
Add to the translation component by translating relative to the existing transformation.
Parameters: - vector : Vector
relative value to translate by
- space : Space.Space
transform space in which to perform the scale
values: ‘transform’, ‘preTransform’, ‘object’, ‘world’
Derived from api method maya.OpenMaya.MSpace.addTranslation
Undo is not currently supported for this method
- apicls¶
alias of MTransformationMatrix
- asMatrixInverse()¶
Returns the inverse of the four by four matrix that describes this transformation.
Return type: Matrix Derived from api method maya.OpenMaya.MTransformationMatrix.asMatrixInverse
- asRotateMatrix()¶
Returns rotate space matrix. The rotate space matrix takes points from object space to the space immediately following the scale/shear/rotation transformations.
Return type: Matrix Derived from api method maya.OpenMaya.MTransformationMatrix.asRotateMatrix
- asScaleMatrix()¶
Returns scale space matrix. The scale space matrix takes points from object space to the space immediately following scale and shear transformations.
Return type: Matrix Derived from api method maya.OpenMaya.MTransformationMatrix.asScaleMatrix
- cnames = ('a00', 'a01', 'a02', 'a03', 'a10', 'a11', 'a12', 'a13', 'a20', 'a21', 'a22', 'a23', 'a30', 'a31', 'a32', 'a33')¶
- euler¶
The euler rotation expressed in this TransformationMatrix, in transform space
- eulerRotation()¶
- getRotatePivot(space)¶
Returns the pivot around which the rotation is applied.
Parameters: - space : Space.Space
space in which to get the pivot
values: ‘transform’, ‘preTransform’, ‘object’, ‘world’
Return type: Derived from api method maya.OpenMaya.MSpace.rotatePivot
- getRotatePivotTranslation(space)¶
Returns the rotation pivot translation. This is the translation that is used to compensate for the movement of the rotation pivot.
Parameters: - space : Space.Space
space in which to get the pivot translation
values: ‘transform’, ‘preTransform’, ‘object’, ‘world’
Return type: Derived from api method maya.OpenMaya.MSpace.rotatePivotTranslation
- getRotation()¶
- getRotationOrientation()¶
Returns the rotation orientation for the transformation matrix. The rotation orientation is the rotation that orients the local rotation space. The rotation is returned in MSpace::kTransform space.
Return type: Quaternion Derived from api method maya.OpenMaya.MTransformationMatrix.rotationOrientation
- getRotationQuaternion()¶
Get the rotation component of the transformation matrix as a quaternion. The rotation is retrieved in MSpace::kTransform space.
Return type: (float, float, float, float) Derived from api method maya.OpenMaya.MTransformationMatrix.getRotationQuaternion
- getScale(space)¶
Get the scale component of the transformation matrix.
Parameters: - space : Space.Space
transform space in which to get the scale
values: ‘transform’, ‘preTransform’, ‘object’, ‘world’
Return type: (float, float, float)
Derived from api method maya.OpenMaya.MSpace.getScale
- getScalePivot(space)¶
Returns the pivot around which the scale is applied.
Parameters: - space : Space.Space
space in which to get the pivot
values: ‘transform’, ‘preTransform’, ‘object’, ‘world’
Return type: Derived from api method maya.OpenMaya.MSpace.scalePivot
- getScalePivotTranslation(space)¶
Returns the scale pivot translation. This is the translation that is used to compensate for the movement of the scale pivot.
Parameters: - space : Space.Space
space in which to get the pivot
values: ‘transform’, ‘preTransform’, ‘object’, ‘world’
Return type: Derived from api method maya.OpenMaya.MSpace.scalePivotTranslation
- getShear(space)¶
Get the shear component of the transformation matrix.
Parameters: - space : Space.Space
Transform space in which to get the shear.
values: ‘transform’, ‘preTransform’, ‘object’, ‘world’
Return type: (float, float, float)
Derived from api method maya.OpenMaya.MSpace.getShear
- getTranslation(space)¶
Returns the translation component of the translation as a vector in linear units.
Parameters: - space : Space.Space
space in which to perform the translation
values: ‘transform’, ‘preTransform’, ‘object’, ‘world’
Return type: Derived from api method maya.OpenMaya.MSpace.getTranslation
- identity = TransformationMatrix([[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]])¶
- ndim = 2¶
- reorderRotation(order)¶
Reorders the x, y, and z components of the rotation of this transform. The overall rotation will remain the same. This operation is not unique, so spin information will be lost.
Parameters: - order : TransformationMatrix.RotationOrder
new order of the rotations
values: ‘XYZ’, ‘YZX’, ‘ZXY’, ‘XZY’, ‘YXZ’, ‘ZYX’
Derived from api method maya.OpenMaya.MTransformationMatrix.reorderRotation
Undo is not currently supported for this method
- rotate¶
The quaternion rotation expressed in this TransformationMatrix, in transform space
- rotateBy(q, space)¶
Adds to the rotation component of the rotation matrix by rotating relative to the existing transformation using a quaternion. The only valid transformation spaces for this method are MSpace::kTransform and MSpace::kPreTransform /MSpacekObject. All other spaces are treated as being equivalent to MSpace::kTransform .
Parameters: - q : Quaternion
the quaternion that indicates how much the transformation matrix will be rotated by
- space : Space.Space
the space in which the rotation is performed
values: ‘transform’, ‘preTransform’, ‘object’, ‘world’
Return type: Derived from api method maya.OpenMaya.MSpace.rotateBy
- rotateTo(value)¶
Set to the given rotation (and result self)
Value may be either a Quaternion, EulerRotation object, or a list of floats; if it is floats, if it has length 4 it is interpreted as a Quaternion; if 3, as a EulerRotation.
- rotationOrder()¶
Returns the rotation order for the transform matrix. That is the order in which the Euler angles are applied to create the end rotation.
Return type: TransformationMatrix.RotationOrder Derived from api method maya.OpenMaya.MTransformationMatrix.rotationOrder
- scale¶
The scale expressed in this TransformationMatrix, in transform space
- setRotatePivot(point, space, balance)¶
Set the pivot around which the rotation is applied.
Parameters: - point : Point
new rotation pivot
- space : Space.Space
transform space in which to set the pivot
values: ‘transform’, ‘preTransform’, ‘object’, ‘world’
- balance : bool
whether to balance the matrix
Derived from api method maya.OpenMaya.MSpace.setRotatePivot
- setRotatePivotTranslation(vector, space)¶
Set the pivot translation. This component is used to preserve existing transformations when moving pivot. This method will only be useful to advanced users.
Parameters: - vector : Vector
new rotation pivot translation
- space : Space.Space
transform space in which to set the rotation translation
values: ‘transform’, ‘preTransform’, ‘object’, ‘world’
Derived from api method maya.OpenMaya.MSpace.setRotatePivotTranslation
- setRotation(*args)¶
- setRotationOrientation(q)¶
Sets the rotation orientation for the transformation matrix. The rotation orientation is the rotation that orients the local rotation space. The rotation is set in MSpace::kTransform space.
Parameters: - q : Quaternion
Rotation quaternion.
Return type: Derived from api method maya.OpenMaya.MTransformationMatrix.setRotationOrientation
- setRotationQuaternion(x, y, z, w)¶
Set the rotation component of the transformation matrix using a quaternion. The rotation is set in MSpace::kTransform space.
Parameters: - x : float
x component of new quaternion
- y : float
y component of new quaternion
- z : float
z component of new quaternion
- w : float
w component of new quaternion
Derived from api method maya.OpenMaya.MTransformationMatrix.setRotationQuaternion
- setScale(scale, space)¶
Set the scale component of the transformation matrix.
Parameters: - scale : (float, float, float)
new scale component
- space : Space.Space
transform space in which to perform the scale
values: ‘transform’, ‘preTransform’, ‘object’, ‘world’
Derived from api method maya.OpenMaya.MSpace.setScale
- setScalePivot(point, space, balance)¶
Set the pivot around which the scale is applied.
Parameters: - point : Point
new scale pivot
- space : Space.Space
transform space in which to set the scale pivot
values: ‘transform’, ‘preTransform’, ‘object’, ‘world’
- balance : bool
whether to balance the matrix
Derived from api method maya.OpenMaya.MSpace.setScalePivot
- setScalePivotTranslation(vector, space)¶
Set the pivot translation. This component is used to preserve existing scale transformations when moving pivot. This method will only be useful to advanced users.
Parameters: - vector : Vector
new scale pivot translation
- space : Space.Space
transform space in which to set the scale translation
values: ‘transform’, ‘preTransform’, ‘object’, ‘world’
Derived from api method maya.OpenMaya.MSpace.setScalePivotTranslation
- setShear(shear, space)¶
Set the shear component of the transformation matrix. The shear values represent (xy, xz, yx).
Parameters: - shear : (float, float, float)
new shear component
- space : Space.Space
transform space in which to perform the shear
values: ‘transform’, ‘preTransform’, ‘object’, ‘world’
Derived from api method maya.OpenMaya.MSpace.setShear
- setToRotationAxis(axis, rotation)¶
Sets the rotation given an axis and a rotation about it.
Parameters: - axis : Vector
axis to rotate about
- rotation : float
rotation in radians
Derived from api method maya.OpenMaya.MTransformationMatrix.setToRotationAxis
Undo is not currently supported for this method
- setTranslation(vector, space)¶
Set the translation component of the transformation matrix in linear units.
Parameters: - vector : Vector
new translation component in centimeters.
- space : Space.Space
transform space in which to perform the translation
values: ‘transform’, ‘preTransform’, ‘object’, ‘world’
Derived from api method maya.OpenMaya.MSpace.setTranslation
- shape = (4, 4)¶
- size = 16¶
- translate¶
The translation expressed in this TransformationMatrix, in transform space