paya.runtime.plugs.Quaternion#

class Quaternion(*args, **kwargs)#

Inheritance

Math Attribute Attribute PyNode ProxyUnicode

get(plug=False, default=None, **kwargs)#

Overloads paya.runtime.plugs.Attribute.get() to return Quaternion instances instead of tuples.

__add__(other, swap=False)#

Implements addition (+).

Parameters

other – a value or plug of dimension 1 or 4

__radd__(other)#

Implements reflected addition (+). See __add__().

__sub__(other, swap=False)#

Implements subtraction (-).

Parameters

other – a value or plug of dimension 1 or 4

__rsub__(other)#

Implements reflected subtraction (-). See __sub__().

__mul__(other, swap=False)#

Implements multiplication (*). Slerp interpolation from an identity quaternion will be used if other is a scalar.

Parameters

other – a value or plug of dimension 1 or 4

__rmul__(other)#

Implements reflected multiplication (*). See __mul__().

__neg__()#

Implements unary negation (-) via quatNegate.

inverse()#
Returns

The inverse of this quaternion.

Return type

Quaternion

normal()#
Returns

The normalized quaternion.

Return type

Quaternion

conjugate()#
Returns

The conjugated quaternion.

Return type

Quaternion

blend(other, weight=0.5, swap=False, angleInterpolation='Shortest')#

Blends this quaternion towards other.

Parameters
  • other (list, Quaternion, Quaternion) – the quaternion value or plug towards which to blend

  • weight/w (int, float, Math1D) – ‘other’ will be fully active at 1.0; defaults to 0.5

  • swap (bool) – reverse operands, defaults to False

  • angleInterpolation (str (an enum name from QuatSlerp.angleInterpolation, int, or Math1D) – the type of slerp interpolation to use, defaults to ‘Shortest’

Returns

The blended output.

Return type

Quaternion

asEulerRotation(rotateOrder='xyz')#

Returns this quaternion as an euler compound.

Parameters

rotateOrder/ro (int, str, Math1D) – the rotate order, defaults to ‘xyz’

Returns

The euler rotation.

Return type

Math3D

asAxisAngle()#

Returns this quaternion as a tuple of axis, angle outputs.

Returns

The axis (vector) and angle outputs.

Return type

tuple

asRotateMatrix()#

Returns this quaternion as a rotation matrix.

Returns

The rotation matrix.

Return type

Matrix