pymel.core.datatypes.EulerRotation¶
digraph inheritance1cb714e176 { 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]; "EulerRotation" [fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",URL="#pymel.core.datatypes.EulerRotation",style="setlinewidth(0.5)",tooltip="unit handling:",height=0.25,shape=box,fontsize=8]; "Array" -> "EulerRotation" [arrowsize=0.5,style="setlinewidth(0.5)"]; "MEulerRotation" -> "EulerRotation" [arrowsize=0.5,style="setlinewidth(0.5)"]; "MEulerRotation" [shape=box,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=8,style="setlinewidth(0.5)",height=0.25]; }
- class EulerRotation(*args, **kwargs)¶
unit handling: >>> from pymel.all import * >>> import pymel.core.datatypes as dt >>> >>> currentUnit(angle=’degree’) u’degree’ >>> e = dt.EulerRotation([math.pi,0,0], unit=’radians’) >>> e dt.EulerRotation([3.14159265359, 0.0, 0.0], unit=’radians’) >>> e2 = dt.EulerRotation([180,0,0], unit=’degrees’) >>> e2 dt.EulerRotation([180.0, 0.0, 0.0]) >>> e.isEquivalent( e2 ) True >>> e == e2 True
units are only displayed when they do not match the current ui unit >>> dt.Angle.getUIUnit() # check current angular unit ‘degrees’ >>> e dt.EulerRotation([3.14159265359, 0.0, 0.0], unit=’radians’) >>> dt.Angle.setUIUnit(‘radians’) # change to radians >>> e dt.EulerRotation([3.14159265359, 0.0, 0.0])
- RotationOrder = Enum( EnumValue('RotationOrder', 0, 'XYZ'), EnumValue('RotationOrder', 1, 'YZX'), EnumValue('RotationOrder', 2, 'ZXY'), EnumValue('RotationOrder', 3, 'XZY'), EnumValue('RotationOrder', 4, 'YXZ'), EnumValue('RotationOrder', 5, 'ZYX'))¶
- __add__(other)¶
u.__add__(v) <==> u+v Returns the result of the addition of u and v if v is convertible to a VectorN (element-wise addition), adds v to every component of u if v is a scalar
- __contains__(value)¶
True if at least one of the vector components is equal to the argument
- __div__(other)¶
u.__div__(v) <==> u/v Returns the result of the division of u by v if v is convertible to a VectorN (element-wise division), divide every component of u by v if v is a scalar
- __eq__(other)¶
u.__eq__(v) <==> u == v Equivalence test
- __iadd__(other)¶
u.__iadd__(v) <==> u += v In place addition of u and v, see __add__
- __idiv__(other)¶
u.__idiv__(v) <==> u /= v In place division of u by v, see __div__
- __imul__(other)¶
u.__imul__(v) <==> u *= v Valid for EulerRotation * Matrix multiplication, in place transformation of u by Matrix v or EulerRotation by scalar multiplication only
- __isub__(other)¶
u.__isub__(v) <==> u -= v In place substraction of u and v, see __sub__
- __mul__(other)¶
u.__mul__(v) <==> u*v The multiply ‘*’ operator is mapped to the dot product when both objects are Vectors, to the transformation of u by matrix v when v is a MatrixN, to element wise multiplication when v is a sequence, and multiplies each component of u by v when v is a numeric type.
- __ne__(other)¶
u.__ne__(v) <==> u != v Equivalence test
- __neg__()¶
u.__neg__() <==> -u The unary minus operator. Negates the value of each of the components of u
- __radd__(other)¶
u.__radd__(v) <==> v+u Returns the result of the addition of u and v if v is convertible to a VectorN (element-wise addition), adds v to every component of u if v is a scalar
- __rdiv__(other)¶
u.__rdiv__(v) <==> v/u Returns the result of of the division of v by u if v is convertible to a VectorN (element-wise division), invert every component of u and multiply it by v if v is a scalar
- __rmul__(other)¶
u.__rmul__(v) <==> v*u The multiply ‘*’ operator is mapped to the dot product when both objects are Vectors, to the left side multiplication (pre-multiplication) of u by matrix v when v is a MatrixN, to element wise multiplication when v is a sequence, and multiplies each component of u by v when v is a numeric type.
- __rsub__(other)¶
u.__rsub__(v) <==> v-u Returns the result of the substraction of u from v if v is convertible to a VectorN (element-wise substration), replace every component c of u by v-c if v is a scalar
- __sub__(other)¶
u.__sub__(v) <==> u-v Returns the result of the substraction of v from u if v is convertible to a VectorN (element-wise substration), substract v to every component of u if v is a scalar
- alternateSolution()¶
Returns an alternate solution to this rotation. The resulting rotation will be bound between +/- PI, and the rotation order will remain unchanged.
Return type: EulerRotation Derived from api method maya.OpenMaya.MEulerRotation.alternateSolution
- apicls¶
alias of MEulerRotation
- asMatrix()¶
Converts an euler rotation to a rotation matrix.
Return type: Matrix Derived from api method maya.OpenMaya.MEulerRotation.asMatrix
- asQuaternion()¶
Converts an euler rotation to a quaternion.
Return type: Quaternion Derived from api method maya.OpenMaya.MEulerRotation.asQuaternion
- asVector()¶
Converts an euler rotation to a vector. The rotation order component is dropped.
Return type: Vector Derived from api method maya.OpenMaya.MEulerRotation.asVector
- assign(*args, **kwargs)¶
Wrap the Quaternion api assign method
- bound()¶
Returns the result of bounding this rotation to be within +/- PI. Bounding a rotation to be within +/- PI is defined to be the result of offsetting the rotation by +/- 2nPI (term by term) such that the offset is within +/- PI.
Return type: EulerRotation Derived from api method maya.OpenMaya.MEulerRotation.bound
- boundIt(src)¶
Sets this euler rotation to be the input rotation that has been bound to be within +/- PI. Bounding a rotation to be within +/- PI is defined to be the result of offsetting the rotation by +/- 2nPI (term by term) such that the offset is within +/- PI.
Parameters: - src : EulerRotation
the input rotation that will be bound
Return type: Derived from api method maya.OpenMaya.MEulerRotation.boundIt
- closestCut(dst)¶
Returns the closest cut of this rotation to “dst”. The closest cut of rotation A to rotation B is defined to be the rotation that is +/- 2nPI to rotation A (term by term) and within +/- PI to rotation B.
Parameters: - dst : EulerRotation
the range of the closest cut
Return type: Derived from api method maya.OpenMaya.MEulerRotation.closestCut
- closestSolution(dst)¶
Returns the euler rotation that is the closest solution to the “dst” euler rotation.
Parameters: - dst : EulerRotation
the euler rotation to which the solution should be closest
Return type: Derived from api method maya.OpenMaya.MEulerRotation.closestSolution
- cnames = ('x', 'y', 'z')¶
- classmethod decompose(matrix, ord)¶
Decompose a rotation matrix into the desired euler angles with the specified order.
Parameters: - matrix : Matrix
the matrix that will be decomposed into an euler rotation with the specified order
- ord : EulerRotation.RotationOrder
the order which the euler rotation will have
values: ‘XYZ’, ‘YZX’, ‘ZXY’, ‘XZY’, ‘YXZ’, ‘ZYX’
Return type: Derived from api method maya.OpenMaya.MEulerRotation.decompose
- get()¶
Wrap the MEulerRotation api get method
- identity = dt.EulerRotation([0.0, 0.0, 0.0], unit='radians')¶
- incrementalRotateBy(axis, angle)¶
Perform an incremental rotation by the specified axis and angle. The rotation is broken down and performed in smaller steps so that the angles update properly.
Parameters: - axis : Vector
the axis to rotate around
- angle : float
the angle by which to rotate around the axis
Return type: Derived from api method maya.OpenMaya.MEulerRotation.incrementalRotateBy
- inverse()¶
Returns the inverse of this euler rotation. The rotation order will be reversed.
Return type: EulerRotation Derived from api method maya.OpenMaya.MEulerRotation.inverse
- invertIt()¶
Performs an in place inversion of this euler rotation. The rotation order will be reversed.
Return type: EulerRotation Derived from api method maya.OpenMaya.MEulerRotation.invertIt
- isZero(tolerance=1e-10)¶
This method returns true if this euler rotation is zero, within some given tolerance.
Parameters: - tolerance : float
the amount of variation allowed for equivalency to zero
Return type: bool
Derived from api method maya.OpenMaya.MEulerRotation.isZero
- ndim = 1¶
- order¶
- reorder(ord)¶
Returns the reordering of this euler rotation, such that the euler rotation will have the specified rotation order.
Parameters: - ord : EulerRotation.RotationOrder
the new rotation order of the euler rotation
values: ‘XYZ’, ‘YZX’, ‘ZXY’, ‘XZY’, ‘YXZ’, ‘ZYX’
Return type: Derived from api method maya.OpenMaya.MEulerRotation.reorder
- reorderIt(ord)¶
Performs an in place reordering of this euler rotation, such that the euler rotation will have the specified rotation order.
Parameters: - ord : EulerRotation.RotationOrder
the new rotation order of the euler rotation
values: ‘XYZ’, ‘YZX’, ‘ZXY’, ‘XZY’, ‘YXZ’, ‘ZYX’
Return type: Derived from api method maya.OpenMaya.MEulerRotation.reorderIt
- setDisplayUnit(unit)¶
- setToAlternateSolution(src)¶
Sets this euler rotation to an alternate solution of the input rotation. The resulting rotation will be bound between +/- PI, and the rotation order will remain unchanged.
Parameters: - src : EulerRotation
the rotation to compute an alternate solution to
Return type: Derived from api method maya.OpenMaya.MEulerRotation.setToAlternateSolution
- setToClosestCut(src, dst)¶
Sets this rotation to be the closest cut of “src” to “dst”. The closest cut of rotation A to rotation B is defined to be the rotation that is +/- 2nPI to rotation A (term by term) and within +/- PI to rotation B.
Parameters: - src : EulerRotation
the euler rotation whose terms will be offset by +/- 2nPI
- dst : EulerRotation
the range of the closest cut
Return type: Derived from api method maya.OpenMaya.MEulerRotation.setToClosestCut
- setToClosestSolution(src, dst)¶
Sets this euler rotation to the euler rotation that is the closest solution of the “src” euler rotation to the “dst” euler rotation.
Parameters: - src : EulerRotation
the euler rotation whose closest solution will be calculated
- dst : EulerRotation
the euler rotation to which the solution should be closest
Return type: Derived from api method maya.OpenMaya.MEulerRotation.setToClosestSolution
- setValue(v, ord='XYZ')¶
Sets the euler rotation to the values contained in the vector and with the specified rotation order.
Parameters: - v : Vector
vector from which to set the x, y, and z rotation components
- ord : EulerRotation.RotationOrder
the rotation order; the default rotation order is XYZ
values: ‘XYZ’, ‘YZX’, ‘ZXY’, ‘XZY’, ‘YXZ’, ‘ZYX’
Return type: Derived from api method maya.OpenMaya.MEulerRotation.setValue
- shape = (3,)¶
- size = 3¶
- x¶
- y¶
- z¶