TransformationMatrix¶
-
class
cgp_maya_utils.api.TransformationMatrix(matrix=None, translate=None, rotate=None, scale=None, shear=None, rotateOrder=None)¶ Bases:
maya.api.OpenMaya.MTransformationMatrixMTransformationMatrix with custom functionalities
-
classmethod
fromAttribute(attribute, rotateOrder=None)¶ get the transformationMatrix from the specified attribute
Parameters: - attribute (str or
cgp_maya_utils.scene.Attribute) – attribute to get the matrix from - transform.matrix - rotateOrder (str) – rotateOrder of the transformationMatrix to get - use transform one if nothing specified
Returns: the transformationMatrix
Return type: - attribute (str or
-
classmethod
fromMatrix(matrix, rotateOrder=None)¶ get the transformationMatrix from the specified matrix
Parameters: - matrix (list[int, float] or
maya.api.OpenMaya.MMatrix) – MMatrix or 16 numbers list used to initialize the transformationMatrix - rotateOrder (str) – rotateOrder of the transformationMatrix to get
Returns: the transformationMatrix
Return type: - matrix (list[int, float] or
-
classmethod
fromTransforms(translate=None, rotate=None, scale=None, shear=None, rotateOrder=None)¶ get the transformationMatrix from the specified transforms
Parameters: - translate (list[int, float]) – value of translation of the transformationMatrix
- rotate (list[int, float]) – value of rotation of the transformationMatrix
- scale (list[int, float]) – value of scale of the transformationMatrix
- shear (list[int, float]) – value of shear of the transformationMatrix
- rotateOrder (str) – rotateOrder of the transformationMatrix to get
Returns: the transformationMatrix
Return type:
-
classmethod