pymel.core.datatypes.EulerRotation

Inheritance diagram of EulerRotation

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'))
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

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:

EulerRotation

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:

EulerRotation

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:

EulerRotation

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:

EulerRotation

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:

EulerRotation

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:

EulerRotation

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:

EulerRotation

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:

EulerRotation

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:

EulerRotation

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:

EulerRotation

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:

EulerRotation

Derived from api method maya.OpenMaya.MEulerRotation.setValue

shape = (3,)
size = 3
x
y
z

Previous topic

pymel.core.datatypes.Distance

Next topic

pymel.core.datatypes.FloatMatrix

Core

Core Modules

Other Modules

This Page