paya.runtime.data.Vector#
- class Vector(*args, **kwargs)#
Inheritance
- createLocator(name=None, size=1.0)#
- __add__(other)#
Implements addition (
+).Overloads
pymel.core.datatypes.Vector.__add__()to add support for 1D or 3D plugs.
- __radd__(other)#
Implements reflected addition (
+).Overloads
pymel.core.datatypes.Vector.__radd__()to add support for 1D or 3D plugs.
- __sub__(other)#
Implements subtraction (
-).Overloads
pymel.core.datatypes.Vector.__sub__()to add support for 1D or 3D plugs.
- __rsub__(other)#
Implements reflected subtraction (
-).Overloads
pymel.core.datatypes.Vector.__rsub__()to add support for 1D or 3D plugs.
- __mul__(other)#
Implements multiplication (
*).Overloads
pymel.core.datatypes.Vector.__mul__()to add support for 1D, 3D and 16D (matrix) plugs.
- __rmul__(other)#
Implements reflected multiplication (
*).Overloads
pymel.core.datatypes.Vector.__rmul__()to add support for 1D and 3D plugs.
- __truediv__(other)#
Implements division (
/).Overloads
pymel.core.datatypes.Vector.__truediv__()to add support for 1D and 3D plugs.
- __rtruediv__(other)#
Implements reflected division (
/).Overloads
pymel.core.datatypes.Vector.__rtruediv__()to add support for 1D and 3D plugs.
- __xor__(other)#
Uses the exclusive-or operator (
^) to implement point-matrix multiplication.
- __pow__(other)#
Implements power (
**).Overloads
pymel.core.datatypes.Vector.__pow__()to add support for 1D and 3D plugs.
- __rpow__(other)#
Implements reflected power (
**).Overloads
pymel.core.datatypes.Vector.__rpow__()to add support for 1D and 3D plugs.
- blend(other, weight=0.5, swap=False, includeLength=False, clockNormal=None, unwindSwitch=None)#
Blends this triple towards other. Blending will be linear or, if clockNormal is provided, by vector angle.
- Parameters
other (
list[float],Vector,Math3D,str) – the triple or vector towards which to blendweight/w (
str,float,Math1D) – 0.5: the blending weight; when this is 1.0, other will take over fully; can be a value or plug; defaults to0.5swap/sw (bool) – swap the inputs around; defaults to
FalseclockNormal/cn (
list[float],Vector,Math3D,str) – if this isTrue, this output and other will be regarded as vectors, and blended by angle; should be a vector perpendicular to both inputs; defaults toNoneincludeLength/ilg (bool) – ignored if clockNormal was omitted; include vector lengths in the blending calculation; defaults to
FalseunwindSwitch/uws (int, str,
Math1D) –ignored if clockNormal was omitted; an integer value or plug to pick an angle unwinding mode:
0for shortest (the default)1for positive2for negative
- Returns
The blended triple or vector.
- Return type
- rotateByAxisAngle(axisVector, angle)#
- dot(other, normalize=False)#
Returns the dot product of this vector and ‘other’.
Extends the base PyMEL method in these ways:
Adds the ‘normalize’ keyword argument
Works with plugs as well as values (if ‘other’ is a plug, the output will also be a plug)
- cross(other, normalize=False, inlineGate=None, guard=False)#
Returns the cross product of this vector and ‘other’.
- Parameters
normalize/nr (bool) – normalize the output; defaults to False
guard/g (bool) –
if the two vectors are in-line, then:
if other is a plug, switch the
vectorProductto ‘No Operation’if other is a value, return
self
Defaults to
False.inlineGate/ig (
bool,str,Math1D) – if you already have a boolean gate or value state to indicate whether the vectors are in-line, provide it here to prevent redundant checks; if this is provided, guard/g will be overriden toTrue; defaults toNone
- Returns
The cross product.
- Return type
VectororMath3D
- angleTo(other, clockNormal=None)#
Differs from PyMEL’s
pymel.core.datatypes.Vector.angle()in the following ways:Adds the clockNormal option
Unless plugs are involved, the return will be an instance of
Anglerather than afloatUnlike
pymel.core.datatypes.Vector.angle(), which always returns radians, here UI units are use
- projectOnto(other)#
- rejectFrom(other)#
Same as ‘make perpendicular to’ (although length will change). See https://en.wikipedia.org/wiki/Vector_projection.
- asTranslateMatrix()#
- Returns
An identity matrix with this vector / point as the translate component.
- Return type
- asScaleMatrix()#
Uses this vectors’s three components as the magnitudes of an identity matrix’s base vectors.
- Returns
The scale matrix.
- Return type