MTransformationMatrix

Base Class

None.

Constants

NameTypeDescription
kIdentity MTransformationMatrix Identity transformation.
kTolerance float Default tolerance for non-exact equality tests.
Rotation Order
kInvalid int  
kXYZ int  
kYZX int  
kZXY int  
kXZY int  
kYXZ int  
kZYX int  
kLast int Last entry. Used for counting.

Static Methods

None.

Static Attributes

None.

Constructors

SignatureParametersDescription
MTransformationMatrix()   Default constructor. Returns a new MTransformationMatrix object, set to the identity transformation.
MTransformationMatrix(src) src - MTransformationMatrix or MMatrix Returns a new MTransformationMatrix object with the same value as src.

Object Methods

SignatureParametersReturnsDescription
asMatrix(interp=1.0) interp - float MMatrix Interpolates between the identity transformation and that currently in the object, returning the result as an MMatrix. When interp is 0.0 the result will be the identity matrix. When it is 1.0 the result will be the full transformation. If interp is less than 0.0 or greater than 1.0 the result will properly extrapolated.
asMatrixInverse()   MMatrix Returns the inverse of the matrix representing the transformation.
asRotateMatrix()   MMatrix Returns the matrix which takes points from object space to the space immediately following the scale/shear/rotation transformations.
asScaleMatrix()   MMatrix Returns the matrix which takes points from object space to the space immediately following scale and shear transformations.
isEquivalent(other, tolerance=kTolerance) other -
tolerance - float
bool Inexact equality test. Returns true if this transformation's matrix is within tolerance of other's matrix.
reorderRotation(order) order - Rotation Order constant Reference to self. Reorders the transformation's rotate component to give the same overall rotation but using the new order or rotations.
rotateBy(rot, space) rot - MQuaternion or MEulerRotation
space - MSpace constant
Reference to self. Adds rot to the transformation's rotation component.
rotateByComponents(seq, space, asQuaternion=False) seq - sequence of 4 floats or 3 floats and a Rotation Order constant
space - MSpace constant
asQuaternion - bool
Reference to self. Adds the rotation represented by the four parameter values to the transformation's rotate component. If asQuaternion is True then seq must contain four floats representing the x, y, z and w components of a quaternion rotation. If asQuaternion is False then seq must contain three floats representing the x, y and z angles, followed by a Rotation Order constant, which together form an Euler rotation.
rotatePivot(space) space - MSpace constant MPoint Returns the transformation's rotate pivot component.
rotatePivotTranslation(space) space - MSpace constant MVector Returns the transformation's rotate pivot translation component.
rotation(asQuaternion=False) asQuaternion - bool MEulerRotation or MQuaternion Returns the transformation's rotation component as either an Euler rotation or a quaternion.
rotationComponents(asQuaternion=False) asQuaternion - bool [x, y, z, order] or [x, y, z, w] Returns a list containing the four components of the transformation's rotate component. If asQuaternion is True then the first three elements are the quaternion's unreal x, y, and z components, and the fourth is its real w component. If asQuaternion is False then the first three components are the x, y and z Euler rotation angles and the fourth is a Rotation Order constant.
rotationOrder()   Rotation Order constant Returns the order of rotations when the transformation's rotate component is expressed as an euler rotation.
rotationOrientation()   MQuaternion Returns the rotation which orients the local rotation space.
scale(space) space - MSpace constant [sx, sy, sz] Returns a list containing the transformation's scale components.
scaleBy(seq, space) seq - sequence of 3 floats
space - MSpace constant
Reference to self. Multiplies the transformation's scale components by the three floats in seq.
scalePivot(space) space - MSpace constant MPoint Returns the transformation's scale pivot component.
scalePivotTranslation(space) space - MSpace constant MVector Returns the transformation's scale pivot translation component.
setRotatePivot(pivot, space, balance)) pivot - MPoint
space - MSpace constant
balance - bool
Reference to self. Sets the transformation's rotate pivot component.
setRotatePivotTranslation(trans, space) trans - MVector
space - MSpace constant
Reference to self. Sets the transformation's rotate pivot translation component.
setRotation(rot) rot - MQuaternion or MEulerRotation Reference to self. Sets the transformation's rotation component to rot.
setRotationComponents(seq, asQuaternion=False) seq - sequence of 4 floats or 3 floats and a Rotation Order constant
asQuaternion - bool
Reference to self. Sets the transformation's rotate component. If asQuaternion is True then seq must contain four floats representing the x, y, z and w components of a quaternion rotation. If asQuaternion is False then seq must contain three floats representing the x, y and z angles, followed by a Rotation Order constant, which together form an Euler rotation.
setRotationOrientation(rot) rot - MQuaternion Reference to self Sets the rotation which orients the local rotation space.
setScale(seq, space) seq - sequence of 3 floats
space - MSpace constant
Reference to self. Sets the transformation's scale components to the three floats in seq.
setScalePivot(pivot, space, balance) pivot - MPoint
space - MSpace constant
balance - bool
Reference to self. Sets the transformation's scale pivot component.
setScalePivotTranslation(trans, space) trans - MVector
space - MSpace constant
Reference to self. Sets the transformation's scale pivot translation component.
setShear(seq, space) seq - sequence of 3 floats
space - MSpace constant
Reference to self. Sets the transformation's shear component.
setTranslation(trans, space) trans - MVector
space - MSpace constant
Reference to self. Sets the transformation's translation component.
setToRotationAxis(axis, rot) axis - MVector
rot - float
Reference to self. Sets the transformation's rotate component to be rot radians around axis.
shear(space) space - MSpace constant [x, y, z] Returns a list containing the transformation's shear component.
shearBy(seq, space) seq - sequence of 3 floats
space - MSpace constant
Reference to self. Multiplies the transformation's shear components by the elements of seq.
translateBy(vec, space) vec - MVector
space - MSpace constant
Reference to self. Adds vec to the transformation's translation component.
translation(space) space - MSpace constant MVector Returns the transformation's translation component as a vector.

Object Attributes

None.

Sequence Support

None.

Number Support

None.

Comparison Support

== Exact equality comparison. True if the matrices of both transformations are identical.
!= Exact inequality comparison. True if the matrices of the two transformations are different.

All other comparison operators will raise a TypeError exception.

© 2011 Autodesk, Inc. All rights reserved.