Python API 2.0 Reference
|
Public Member Functions | |
def | __add__ () |
def | __delitem__ () |
def | __eq__ () |
def | __ge__ () |
def | __getitem__ () |
def | __gt__ () |
def | __iadd__ () |
def | __imul__ () |
def | __init__ () |
def | __isub__ () |
def | __le__ () |
def | __len__ () |
def | __lt__ () |
def | __mul__ () |
def | __ne__ () |
def | __neg__ () |
def | __radd__ () |
def | __repr__ () |
def | __rmul__ () |
def | __rsub__ () |
def | __setitem__ () |
def | __str__ () |
def | __sub__ () |
def | alternateSolution () |
def | asMatrix () |
def | asQuaternion () |
def | asVector () |
def | bound () |
def | boundIt () |
def | closestCut () |
def | closestSolution () |
def | incrementalRotateBy () |
def | inverse () |
def | invertIt () |
def | isEquivalent () |
def | isZero () |
def | reorder () |
def | reorderIt () |
def | setToAlternateSolution () |
def | setToClosestCut () |
def | setToClosestSolution () |
def | setValue () |
Static Public Member Functions | |
def | __new__ () |
def | computeAlternateSolution () |
def | computeBound () |
def | computeClosestCut () |
def | computeClosestSolution () |
def | decompose () |
Static Public Attributes | |
tuple | kIdentity = maya.api.OpenMaya.MEulerRotation(0, 0, 0, maya.api.OpenMaya.MEulerRotation.kXYZ) |
int | kTolerance = 1 |
Rotation Orders | |
int | kXYZ = 0 |
int | kXZY = 3 |
int | kYXZ = 4 |
int | kYZX = 1 |
int | kZXY = 2 |
int | kZYX = 5 |
Properties | |
order = property(...) | |
x = property(...) | |
y = property(...) | |
z = property(...) | |
X, Y and Z rotations, applied in a specified order.
Signature | Parameters | Description |
---|---|---|
MEulerRotation() | Default constructor. Returns a new MEulerRotation object, initialized to the identity rotation. | |
MEulerRotation(src) | src - MEulerRotation | Copy constructor. Returns a new MEulerRotation object with the same value as src. |
MEulerRotation(vec, order=kXYZ) | vec - MVector order - Rotation Order constant | Returns a new MEulerRotation with the given order and its X, Y and Z rotations set to the corresponding elements of vec. |
MEulerRotation(seq, order=kXYZ) | seq - sequence of three floats. order - Rotation Order constant | Returns a new MEulerRotation with the given order and its X, Y and Z rotations set to the corresponding elements of seq. |
MEulerRotation(x, y, z, order=kXYZ) | x - float y - float z - float order - Rotation Order constant | Returns a new MEulerRotation with the specified x, y and z rotations and the given rotation order. |
An MEulerRotation is treated as a sequence of three float values: [x, y, z].
len() returns 3.
Indexing and element assignment are supported.
Deletion, concatenation, repetition and slicing are not supported.
Operation | Result |
---|---|
MEulerRotation = MEulerRotation + MEulerRotation | Component-by-component addition. Right operand is first reordered to match left, if necessary. |
MEulerRotation += MEulerRotation | In-place addition. Right operand is first reordered to match left, if necessary. Returns a new reference to the rotation. |
MEulerRotation = MEulerRotation - MEulerRotation | Component-by-component subtraction. Right operand is first reordered to match left, if necessary. |
MEulerRotation -= MEulerRotation | In-place subtraction. Right operand is first reordered to match left, if necessary. Returns a new reference to the rotation. |
MEulerRotation = -MEulerRotation | Each component is negated. Rotation order is unchanged. |
MEulerRotation = MEulerRotation * MEulerRotation | Multiplication of rotations. Rotation order of left operand is preserved. |
MEulerRotation *= MEulerRotation | In-place multiplication of rotations. Rotation order of left operand is preserved. Returns a new reference to the rotation. |
MEulerRotation = MEulerRotation * MQuaternion | Multiplication of rotation by a quaternion. Rotation order of left operand is preserved. |
MEulerRotation *= MQuaternion | In-place multiplication of rotation by a quaternion. Rotation order of left operand is preserved. Returns a new reference to the rotation. |
MEulerRotation = MEulerRotation * float | Component-by-component multiplication by a scalar. |
MEulerRotation *= float | In-place multiplication by a scalar. Returns a new reference to the rotation. |
== | Exact equality comparison. True if the order and rotational components of the left operand are exactly equal to those of the right. |
!= | Exact inequality comparison. True if the order or the left and right operands are different or if any of their rotational components are not exactly equal. |
All other comparison operators will raise a TypeError exception.
def OpenMaya.MEulerRotation.__init__ | ( | ) |
Initialize self. See help(type(self)) for accurate signature.
def OpenMaya.MEulerRotation.__add__ | ( | ) |
Return self+value.
def OpenMaya.MEulerRotation.__delitem__ | ( | ) |
Delete self[key].
def OpenMaya.MEulerRotation.__eq__ | ( | ) |
Return self==value.
def OpenMaya.MEulerRotation.__ge__ | ( | ) |
Return self>=value.
def OpenMaya.MEulerRotation.__getitem__ | ( | ) |
Return self[key].
def OpenMaya.MEulerRotation.__gt__ | ( | ) |
Return self>value.
def OpenMaya.MEulerRotation.__iadd__ | ( | ) |
Return self+=value.
def OpenMaya.MEulerRotation.__imul__ | ( | ) |
Return self*=value.
def OpenMaya.MEulerRotation.__isub__ | ( | ) |
Return self-=value.
def OpenMaya.MEulerRotation.__le__ | ( | ) |
Return self<=value.
def OpenMaya.MEulerRotation.__len__ | ( | ) |
Return len(self).
def OpenMaya.MEulerRotation.__lt__ | ( | ) |
Return self<value.
def OpenMaya.MEulerRotation.__mul__ | ( | ) |
Return self*value.
def OpenMaya.MEulerRotation.__ne__ | ( | ) |
Return self!=value.
def OpenMaya.MEulerRotation.__neg__ | ( | ) |
-self
|
static |
Create and return a new object. See help(type) for accurate signature.
def OpenMaya.MEulerRotation.__radd__ | ( | ) |
Return value+self.
def OpenMaya.MEulerRotation.__repr__ | ( | ) |
Return repr(self).
def OpenMaya.MEulerRotation.__rmul__ | ( | ) |
Return value*self.
def OpenMaya.MEulerRotation.__rsub__ | ( | ) |
Return value-self.
def OpenMaya.MEulerRotation.__setitem__ | ( | ) |
Set self[key] to value.
def OpenMaya.MEulerRotation.__str__ | ( | ) |
Return str(self).
def OpenMaya.MEulerRotation.__sub__ | ( | ) |
Return self-value.
OpenMaya.MEulerRotation.alternateSolution | ( | ) |
Returns an equivalent rotation which is not simply a multiple.
Signature: | alternateSolution() |
Parameters: | |
Returns: | MEulerRotation |
Description: | Returns a new MEulerRotation with a different rotation which is equivalent to this one and has the same rotation order. Each rotation component will lie within +/- PI. |
OpenMaya.MEulerRotation.asMatrix | ( | ) |
Returns the rotation as an equivalent matrix.
Signature: | asMatrix() |
Parameters: | |
Returns: | MMatrix |
Description: | Returns the rotation as an equivalent matrix. |
OpenMaya.MEulerRotation.asQuaternion | ( | ) |
Returns the rotation as an equivalent quaternion.
Signature: | asQuaternion() |
Parameters: | |
Returns: | MQuaternion |
Description: | Returns the rotation as an equivalent quaternion. |
OpenMaya.MEulerRotation.asVector | ( | ) |
Returns the X, Y and Z rotations as a vector.
Signature: | asVector() |
Parameters: | |
Returns: | MVector |
Description: | Returns the X, Y and Z rotations as a vector. Rotation order is ignored. |
OpenMaya.MEulerRotation.bound | ( | ) |
Returns a new MEulerRotation having this rotation, but with each rotation component bound within +/- PI.
Signature: | bound() |
Parameters: | |
Returns: | MEulerRotation |
Description: | Returns a new MEulerRotation having this rotation, but with each rotation component bound within +/- PI. |
OpenMaya.MEulerRotation.boundIt | ( | ) |
In-place bounding of each rotation component to lie wthin +/- PI.
Signature: | boundIt() |
Parameters: | |
Returns: | Reference to self. |
Description: | In-place bounding of each rotation component to lie wthin +/- PI. |
Signature: | boundIt(rot) |
Parameters: | rot - MEulerRotation |
Returns: | Reference to self. |
Description: | Replace this rotation with the bound version of rot. |
OpenMaya.MEulerRotation.closestCut | ( | ) |
Returns the rotation which is full spin multiples of this one and comes closest to target.
Signature: | closestCut(target) |
Parameters: | target - MEulerRotation |
Returns: | MEulerRotation |
Description: | Returns a new MEulerRotation containing the rotation which is full spin multiples of this one and comes closest to target. |
OpenMaya.MEulerRotation.closestSolution | ( | ) |
Returns the equivalent rotation which comes closest to a target.
Signature: | closestSolution(target) |
Parameters: | target - MEulerRotation |
Returns: | MEulerRotation |
Description: | Returns a new MEulerRotation containing the rotation equivalent to this one which comes closest to target. |
|
static |
Returns an equivalent rotation which is not simply a multiple.
Name: | computeAlternateSolution(rot) |
Parameters: | rot - MEulerRotation |
Returns: | MEulerRotation |
Description: | Returns a rotation equivalent to rot which is not simply a multiple of it. |
|
static |
Returns an equivalent rotation with each rotation component bound within +/- PI.
Name: | computeBound(rot) |
Parameters: | rot - MEulerRotation |
Returns: | MEulerRotation |
Description: | Returns a rotation equivalent to rot but bound within +/- PI. |
|
static |
Returns the rotation which is full spin multiples of the src and comes closest to target.
Name: | computeClosestCut(src, target) |
Parameters: | src - MEulerRotation target - MEulerRotation |
Returns: | MEulerRotation |
Description: | Returns the rotation which is full spin multiples of src and comes closest to target. |
|
static |
Returns the equivalent rotation which comes closest to a target.
Name: | computeClosestSolution(src, target) |
Parameters: | src - MEulerRotation target - MEulerRotation |
Returns: | MEulerRotation |
Description: | Returns the rotation equivalent to src which comes closest to target. |
|
static |
Extracts a rotation from a matrix.
Name: | decompose(matrix, order) |
Parameters: | matrix - MMatrix order - Rotation Order constant |
Returns: | MEulerRotation |
Description: | Extracts from matrix a valid rotation having the specified rotation order. Note that this may be just one of several different rotations which could each give rise to the same matrix. |
OpenMaya.MEulerRotation.incrementalRotateBy | ( | ) |
Increase this rotation by a given angle around the specified axis. The update is done in series of small increments to avoid flipping.
Signature: | incrementalRotateBy(axis, angle) |
Parameters: | axis - MVector angle - float |
Returns: | Reference to self. |
Description: | Increase this rotation by angle radians around the specified axis. The update is done in series of small increments to avoid flipping. |
OpenMaya.MEulerRotation.inverse | ( | ) |
Returns a new MEulerRotation containing the inverse rotation of this one and reversed rotation order.
Signature: | inverse() |
Parameters: | |
Returns: | MEulerRotation |
Description: | Returns a new MEulerRotation containing the inverse rotation of this one and reversed rotation order. |
OpenMaya.MEulerRotation.invertIt | ( | ) |
In-place inversion of the rotation. Rotation order is also reversed.
Signature: | invertIt() |
Parameters: | |
Returns: | Reference to self. |
Description: | In-place inversion of the rotation. Rotation order is also reversed. |
OpenMaya.MEulerRotation.isEquivalent | ( | ) |
Returns true if this rotation has the same order as another and their X, Y and Z components are within a tolerance of each other.
Signature: | isEquivalent(other, tolerance=kTolerance) |
Parameters: | other - MEulerRotation tolerance - float |
Returns: | bool |
Description: | Inexact equality test. Returns true if this rotation has the same order as other and their X, Y and Z components are within tolerance of each other. |
OpenMaya.MEulerRotation.isZero | ( | ) |
Returns true if the X, Y and Z components are each within a tolerance of 0.0.
Signature: | isZero(tolerance=kTolerance) |
Parameters: | tolerance - float |
Returns: | bool |
Description: | Inexact zero test. Returns true if the X, Y and Z components are each within tolerance of 0.0. |
OpenMaya.MEulerRotation.reorder | ( | ) |
Returns a new MEulerRotation having this rotation, reordered to use the given rotation order.
Signature: | reorder(order) |
Parameters: | order - Rotation Order constant |
Returns: | MEulerRotation |
Description: | Returns a new MEulerRotation having this rotation, reordered to use the given rotation order. |
OpenMaya.MEulerRotation.reorderIt | ( | ) |
In-place reordering to use the given rotation order.
Signature: | reorderIt(order) |
Parameters: | order - Rotation Order constant |
Returns: | Reference to self. |
Description: | In-place reordering to use the given rotation order. |
OpenMaya.MEulerRotation.setToAlternateSolution | ( | ) |
Replace this rotation with an alternate solution.
Signature: | setToAlternateSolution() |
Parameters: | |
Returns: | Reference to self. |
Description: | Replace with a different but equivalent rotation, having the same rotation order and with each rotation component lying wthin +/- PI. |
Signature: | setToAlternateSolution(rot) |
Parameters: | rot - MEulerRotation |
Returns: | Reference to self. |
Description: | Replace this rotation with the alternate solution for rot. |
OpenMaya.MEulerRotation.setToClosestCut | ( | ) |
Replace this rotation with the closest cut to a target.
Signature: | setToClosestCut(target) |
Parameters: | target - MEulerRotation |
Returns: | Reference to self. |
Description: | Replace this rotation with the one which is full spin multiples of this one and comes closest to target. |
Signature: | setToClosestCut(src, target) |
Parameters: | src - MEulerRotation target - MEulerRotation |
Returns: | Reference to self. |
Description: | Replace this rotation with the closest cut of src to target. |
OpenMaya.MEulerRotation.setToClosestSolution | ( | ) |
Replace this rotation with the closest solution to a target.
Signature: | setToClosestSolution(target) |
Parameters: | target - MEulerRotation |
Returns: | Reference to self. |
Description: | Replace this rotation with the equivalent rotation which comes closest to target. |
Signature: | setToClosestSolution(src, target) |
Parameters: | src - MEulerRotation target - MEulerRotation |
Returns: | Reference to self. |
Description: | Replace this rotation with the closest solution of src to target. |
OpenMaya.MEulerRotation.setValue | ( | ) |
Set the rotation.
Signature: | setValue(rot) |
Parameters: | rot - MEulerRotation |
Returns: | Reference to self. |
Description: | Set the rotation and order to match that of rot. |
Signature: | setValue(quat) |
Parameters: | quat - MQuaternion |
Returns: | Reference to self. |
Description: | Set the rotation and order to provide a rotation equivalent to that of rot. |
Signature: | setValue(mat) |
Parameters: | mat - MMatrix |
Returns: | Reference to self. |
Description: | Set the rotation order and the X, Y and Z rotations to those extracted from mat, as per the decompose() method, using the current order. |
Signature: | setValue(vec, order=kXYZ) |
Parameters: | vec - MVector order - Rotation Order constant |
Returns: | Reference to self. |
Description: | Set the rotation order to order and set the X, Y and Z rotations to the corresponding components of vec. |
Signature: | setValue(seq, order=kXYZ) |
Parameters: | seq - sequence of three floats order - Rotation Order constant |
Returns: | Reference to self. |
Description: | Set the rotation order to order and the X, Y and Z rotations to the corresponding components of seq. |
Signature: | setValue(x, y, z, order=kXYZ) |
Parameters: | x - float y - float z - float order - Rotation Order constant |
Returns: | Reference to self. |
Description: | Set the given rotation order and x, y and z rotation components. |
|
static |
Name: | kIdentity |
Type: | MEulerRotation |
Description: | Rotation (0, 0, 0), kXYZ order |
|
static |
Name: | kTolerance |
Type: | float |
Description: | Default tolerance for non-exact equality tests. |
|
static |
Name: | kXYZ |
Type: | int |
Description: |
|
static |
Name: | kXZY |
Type: | int |
Description: |
|
static |
Name: | kYXZ |
Type: | int |
Description: |
|
static |
Name: | kYZX |
Type: | int |
Description: |
|
static |
Name: | kZXY |
Type: | int |
Description: |
|
static |
Name: | kZYX |
Type: | int |
Description: |
|
static |
Rotation order
Name: | order |
Type: | int |
Access: | RW |
Description: | One of the Rotation Order constants. |
|
static |
X rotation in radians
Name: | x |
Type: | float |
Access: | RW |
Description: | X component of rotation, in radians |
|
static |
Y rotation in radians
Name: | y |
Type: | float |
Access: | RW |
Description: | Y component of rotation, in radians |
|
static |
Z rotation in radians
Name: | z |
Type: | float |
Access: | RW |
Description: | Z component of rotation, in radians |