| Python API 2.0 Reference
    | 
 Inheritance diagram for OpenMaya.MVector:
 Inheritance diagram for OpenMaya.MVector:| Public Member Functions | |
| def | __add__ () | 
| def | __delitem__ () | 
| def | __div__ () | 
| def | __eq__ () | 
| def | __ge__ () | 
| def | __getitem__ () | 
| def | __gt__ () | 
| def | __iadd__ () | 
| def | __idiv__ () | 
| def | __imul__ () | 
| def | __init__ () | 
| def | __isub__ () | 
| def | __le__ () | 
| def | __len__ () | 
| def | __lt__ () | 
| def | __mul__ () | 
| def | __ne__ () | 
| def | __neg__ () | 
| def | __radd__ () | 
| def | __rdiv__ () | 
| def | __repr__ () | 
| def | __rmul__ () | 
| def | __rsub__ () | 
| def | __rxor__ () | 
| def | __setitem__ () | 
| def | __str__ () | 
| def | __sub__ () | 
| def | __xor__ () | 
| def | angle () | 
| def | isEquivalent () | 
| def | isParallel () | 
| def | length () | 
| def | normal () | 
| def | normalize () | 
| def | rotateBy () | 
| def | rotateTo () | 
| def | transformAsNormal () | 
| Static Public Attributes | |
| int | kTolerance = 1 | 
| Common Vectors | |
| tuple | kOneVector = maya.api.OpenMaya.MVector(1, 1, 1) | 
| tuple | kXaxisVector = maya.api.OpenMaya.MVector(1, 0, 0) | 
| tuple | kXnegAxisVector = maya.api.OpenMaya.MVector(-1, 0, 0) | 
| tuple | kYaxisVector = maya.api.OpenMaya.MVector(0, 1, 0) | 
| tuple | kYnegAxisVector = maya.api.OpenMaya.MVector(0, -1, 0) | 
| tuple | kZaxisVector = maya.api.OpenMaya.MVector(0, 0, 1) | 
| tuple | kZeroVector = maya.api.OpenMaya.MVector(0, 0, 0) | 
| tuple | kZnegAxisVector = maya.api.OpenMaya.MVector(0, 0, -1) | 
| Axis Identifiers | |
| int | kWaxis = 3 | 
| int | kXaxis = 0 | 
| int | kYaxis = 1 | 
| int | kZaxis = 2 | 
| Properties | |
| x = property(...) | |
| y = property(...) | |
| z = property(...) | |
3D vector with double-precision coordinates.
| Signature | Parameters | Description | 
|---|---|---|
| MVector() | Default constructor. Returns a new MVector object initialized to the zero vector. | |
| MVector(src) | src - MVector, MFloatVector, MPoint or MFloatPoint | Copy constructor. Returns a new MVector object whose x, y and z coordinates are set to the x, y and z coordinates of src. | 
| MVector(seq) | seq - sequence of two or three floats | Returns a new MVector object whose x, y and z coordinates are set to the elements of seq. If the sequence only contains two values z will be set to 0.0. | 
| MVector(x, y, z=0.0) | x - float y - float z - float | Returns a new MVector object with the specified x, y and z coordinates. | 
An MVector is treated 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 | Description | 
|---|---|
| MVector = MVector ^ MVector | New vector which is the cross product of the two vectors. | 
| float = MVector * MVector | Dot product of the two vectors. | 
| MVector = MVector / scalar | New vector whose components are those of the given vector, each divided by scalar, which can be of any type which is convertable to float. | 
| MVector /= scalar | Divides each component of the vector by scalar, which can be of any type which is convertable to float, and returns a new reference to the vector. | 
| MVector = MVector * scalar | New vector whose components are those of the given vector, each multiplied by scalar, which can be of any type which is convertable to float. | 
| MVector = scalar * MVector | New vector whose components are those of the given vector, each multiplied by scalar, which can be of any type which is convertable to float. | 
| MVector *= scalar | Multiplies each component of the vector by scalar, which can be of any type which is convertable to float, and returns a new reference to the vector. | 
| MVector = MVector * MMatrix | New vector resulting from postmultiplying the vector by the matrix. | 
| MVector = MMatrix * MVector | New vector resulting from premultiplying the vector by the matrix. | 
| MVector *= MMatrix | Postmultiplies the vector by the matrix and returns a new reference to the vector. | 
| MVector = MVector + MVector | New vector which is the sum of the two vectors. | 
| MVector += MVector | Adds the second vector to the first and returns a new reference to the first. | 
| MVector = -MVector | New vector which is the negative if the given vector. | 
| MVector = MVector - MVector | New vector which is the difference of the two vectors. | 
| MVector -= MVector | Subtracts the second vector from the first and returns a new reference to the first. | 
| MVector == MVector | Returns True if each component of the first vector is exactly equal to the corresponding component of the second. | 
| MVector != MVector | Returns False is any component of the first vector is not exactly equal to the corresponding component of the second. | 
All other comparison operators will raise a TypeError exception.
| def OpenMaya.MVector.__init__ | ( | ) | 
x.__init__(...) initializes x; see help(type(x)) for signature
| def OpenMaya.MVector.__add__ | ( | ) | 
x.__add__(y) <==> x+y
| def OpenMaya.MVector.__delitem__ | ( | ) | 
x.__delitem__(y) <==> del x[y]
| def OpenMaya.MVector.__div__ | ( | ) | 
x.__div__(y) <==> x/y
| def OpenMaya.MVector.__eq__ | ( | ) | 
x.__eq__(y) <==> x==y
| def OpenMaya.MVector.__ge__ | ( | ) | 
x.__ge__(y) <==> x>=y
| def OpenMaya.MVector.__getitem__ | ( | ) | 
x.__getitem__(y) <==> x[y]
| def OpenMaya.MVector.__gt__ | ( | ) | 
x.__gt__(y) <==> x>y
| def OpenMaya.MVector.__iadd__ | ( | ) | 
x.__iadd__(y) <==> x+=y
| def OpenMaya.MVector.__idiv__ | ( | ) | 
x.__idiv__(y) <==> x/=y
| def OpenMaya.MVector.__imul__ | ( | ) | 
x.__imul__(y) <==> x*=y
| def OpenMaya.MVector.__isub__ | ( | ) | 
x.__isub__(y) <==> x-=y
| def OpenMaya.MVector.__le__ | ( | ) | 
x.__le__(y) <==> x<=y
| def OpenMaya.MVector.__len__ | ( | ) | 
x.__len__() <==> len(x)
| def OpenMaya.MVector.__lt__ | ( | ) | 
x.__lt__(y) <==> x<y
| def OpenMaya.MVector.__mul__ | ( | ) | 
x.__mul__(y) <==> x*y
| def OpenMaya.MVector.__ne__ | ( | ) | 
x.__ne__(y) <==> x!=y
| def OpenMaya.MVector.__neg__ | ( | ) | 
x.__neg__() <==> -x
| def OpenMaya.MVector.__radd__ | ( | ) | 
x.__radd__(y) <==> y+x
| def OpenMaya.MVector.__rdiv__ | ( | ) | 
x.__rdiv__(y) <==> y/x
| def OpenMaya.MVector.__repr__ | ( | ) | 
x.__repr__() <==> repr(x)
| def OpenMaya.MVector.__rmul__ | ( | ) | 
x.__rmul__(y) <==> y*x
| def OpenMaya.MVector.__rsub__ | ( | ) | 
x.__rsub__(y) <==> y-x
| def OpenMaya.MVector.__rxor__ | ( | ) | 
x.__rxor__(y) <==> y^x
| def OpenMaya.MVector.__setitem__ | ( | ) | 
x.__setitem__(i, y) <==> x[i]=y
| def OpenMaya.MVector.__str__ | ( | ) | 
x.__str__() <==> str(x)
| def OpenMaya.MVector.__sub__ | ( | ) | 
x.__sub__(y) <==> x-y
| def OpenMaya.MVector.__xor__ | ( | ) | 
x.__xor__(y) <==> x^y
| OpenMaya.MVector.angle | ( | ) | 
Returns the angle, in radians, between this vector and another.
| Signature: | angle(other) | 
| Parameters: | other - MVector | 
| Returns: | float | 
| Description: | Returns the angle, in radians, between this vector and other. | 
| OpenMaya.MVector.isEquivalent | ( | ) | 
Returns True if this vector and another are within a given tolerance of being equal.
| Signature: | isEquivalent(other, tolerance=kTolerance) | 
| Parameters: | other - MVector tolerance - float | 
| Returns: | bool | 
| Description: | Returns True if this vector and other are within the given tolerance of being equal. | 
| OpenMaya.MVector.isParallel | ( | ) | 
Returns True if this vector and another are within the given tolerance of being parallel.
| Signature: | isParallel(other, tolerance=kTolerance) | 
| Parameters: | other - MVector tolerance - float | 
| Returns: | bool | 
| Description: | Returns True if this vector and other are within the given tolerance of being parallel. | 
| OpenMaya.MVector.length | ( | ) | 
Returns the magnitude of this vector.
| Signature: | length() | 
| Parameters: | |
| Returns: | float | 
| Description: | Returns the magnitude of this vector. | 
| OpenMaya.MVector.normal | ( | ) | 
| OpenMaya.MVector.normalize | ( | ) | 
Normalizes this vector in-place and returns a new reference to it.
| Signature: | normalize() | 
| Parameters: | |
| Returns: | MVector | 
| Description: | Normalizes this vector in-place and returns a new reference to it. | 
| OpenMaya.MVector.rotateBy | ( | ) | 
Returns the vector resulting from rotating this one by the given amount.
| Signature: | rotateBy(rot) | 
| Parameters: | rot - MQuaternion or MEulerRotation | 
| Returns: | MVector | 
| Description: | Returns a new vector containing the result of rotating this vector by the rotation given by rot. | 
| Signature: | rotateBy(axis, angle) | 
| Parameters: | axis - Axis identifier constant angle - float | 
| Returns: | MVector | 
| Description: | Returns a new vector containing the result of rotating this vector by angle radians about the specified axis. | 
| OpenMaya.MVector.rotateTo | ( | ) | 
Returns the quaternion which will rotate this vector into another.
| Signature: | rotateTo(target) | 
| Parameters: | target - MVector | 
| Returns: | MQuaternion | 
| Description: | Returns the quaternion which will rotate this vector into the target vector, about their mutually perpendicular axis. | 
| OpenMaya.MVector.transformAsNormal | ( | ) | 
Returns a new vector which is calculated by postmultiplying this vector by the transpose of the given matrix's inverse and then normalizing the result.
| Signature: | transformAsNormal(matrix) | 
| Parameters: | matrix - MMatrix | 
| Returns: | MVector | 
| Description: | Returns a new vector which is calculated by postmultiplying this vector by the transpose of matrix's inverse and then normalizing it. | 
| 
 | static | 
| Name: | kOneVector | 
| Type: | MVector | 
| Description: | (1,1,1) | 
| 
 | static | 
| Name: | kTolerance | 
| Type: | float | 
| Description: | Default tolerance used for inexact comparisons. | 
| 
 | static | 
| Name: | kWaxis | 
| Type: | int | 
| Description: | 
| 
 | static | 
| Name: | kXaxis | 
| Type: | int | 
| Description: | 
| 
 | static | 
| Name: | kXaxisVector | 
| Type: | MVector | 
| Description: | (1,0,0) | 
| 
 | static | 
| Name: | kXnegAxisVector | 
| Type: | MVector | 
| Description: | (-1,0,0) | 
| 
 | static | 
| Name: | kYaxis | 
| Type: | int | 
| Description: | 
| 
 | static | 
| Name: | kYaxisVector | 
| Type: | MVector | 
| Description: | (0,1,0) | 
| 
 | static | 
| Name: | kYnegAxisVector | 
| Type: | MVector | 
| Description: | (0,-1,0) | 
| 
 | static | 
| Name: | kZaxis | 
| Type: | int | 
| Description: | 
| 
 | static | 
| Name: | kZaxisVector | 
| Type: | MVector | 
| Description: | (0,0,1) | 
| 
 | static | 
| Name: | kZeroVector | 
| Type: | MVector | 
| Description: | (0,0,0) | 
| 
 | static | 
| Name: | kZnegAxisVector | 
| Type: | MVector | 
| Description: | (0,0,-1) | 
| 
 | static | 
X coordinate
| Name: | x | 
| Type: | float | 
| Access: | RW | 
| Description: | X component. | 
| 
 | static | 
Y coordinate
| Name: | y | 
| Type: | float | 
| Access: | RW | 
| Description: | Y component. | 
| 
 | static | 
Z coordinate
| Name: | z | 
| Type: | float | 
| Access: | RW | 
| Description: | Z component. |