pymel.core.datatypes.Vector

digraph inheritance05bd61e821 {
rankdir=TB;
ranksep=0.15;
nodesep=0.15;
size="8.0, 12.0";
  "Vector" [fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,URL="#pymel.core.datatypes.Vector",style="setlinewidth(0.5)",height=0.25,shape=box,fontsize=8];
  "VectorN" -> "Vector" [arrowsize=0.5,style="setlinewidth(0.5)"];
  "MVector" -> "Vector" [arrowsize=0.5,style="setlinewidth(0.5)"];
  "VectorN" [fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,URL="../pymel.util.arrays/pymel.util.arrays.VectorN.html#pymel.util.arrays.VectorN",style="setlinewidth(0.5)",height=0.25,shape=box,fontsize=8];
  "Array" -> "VectorN" [arrowsize=0.5,style="setlinewidth(0.5)"];
  "MVector" [shape=box,fontname=Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans,fontsize=8,style="setlinewidth(0.5)",height=0.25];
  "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)",height=0.25,shape=box,fontsize=8];
}

class Vector(*args, **kwargs)

A 3 dimensional vector class that wraps Maya’s api Vector class

>>> from pymel.all import *
>>> import pymel.core.datatypes as dt
>>> 
>>> v = dt.Vector(1, 2, 3)
>>> w = dt.Vector(x=1, z=2)
>>> z = dt.Vector( dt.Vector.xAxis, z=1)
>>> v = dt.Vector(1, 2, 3, unit='meters')
>>> print v
[1.0, 2.0, 3.0]
angle(other)
u.angle(v) <==> angle(u, v) –> float Returns the angle (in radians) between the two vectors u and v Note that this angle is not signed, use axis to know the direction of the rotation
apicls
alias of MVector
assign(value)
Wrap the Vector api assign method
axis(other, normalize=False)
u.axis(v) <==> angle(u, v) –> Vector Returns the axis of rotation from u to v as the vector n = u ^ v if the normalize keyword argument is set to True, n is also normalized
cotan(other)
u.cotan(v) <==> cotan(u, v) –> float : cotangent of the a, b angle, a and b should be MVectors
cross(other)
cross product, only defined for two 3D vectors
data
The Vector/FloatVector/Point/FloatPoint/Color data
distanceTo(other)
dot(other)
dot product of two vectors
get()
Wrap the Vector api get method
isEquivalent(other, tol=None)
Returns true if both arguments considered as Vector are equal within the specified tolerance
isParallel(other, tol=None)
Returns true if both arguments considered as Vector are parallel within the specified tolerance
length()
Return the length of the vector
normal()
Return a normalized copy of self
normalize()
Performs an in place normalization of self
rotateBy(*args)
u.rotateBy(*args) –> Vector Returns the result of rotating u by the specified arguments. There are several ways the rotation can be specified: args is a tuple of one Matrix, TransformationMatrix, Quaternion, EulerRotation arg is tuple of 4 arguments, 3 rotation value and an optionnal rotation order args is a tuple of one Vector, the axis and one float, the angle to rotate around that axis in radians
rotateTo(other)
u.rotateTo(v) –> Quaternion Returns the Quaternion that represents the rotation of the Vector u into the Vector v around their mutually perpendicular axis. It amounts to rotate u by angle(u, v) around axis(u, v)
sqlength()
Return the square length of the vector
transformAsNormal(other)
Returns the vector transformed by the matrix as a normal Normal vectors are not transformed in the same way as position vectors or points. If this vector is treated as a normal vector then it needs to be transformed by post multiplying it by the inverse transpose of the transformation matrix. This method will apply the proper transformation to the vector as if it were a normal.
x
y
z

Previous topic

pymel.core.datatypes.Unit

Next topic

pymel.core.datatypes.VectorN

Core

Core Modules

Other Modules

This Page