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 | __radd__ () |
def | __repr__ () |
def | __rmul__ () |
def | __rsub__ () |
def | __rtruediv__ () |
def | __setitem__ () |
def | __str__ () |
def | __sub__ () |
def | __truediv__ () |
def | cartesianize () |
def | distanceTo () |
def | homogenize () |
def | isEquivalent () |
def | rationalize () |
Static Public Member Functions | |
def | __new__ () |
Static Public Attributes | |
tuple | kOrigin = maya.api.OpenMaya.MPoint(0, 0, 0, 1) |
int | kTolerance = 1 |
Properties | |
w = property(...) | |
x = property(...) | |
y = property(...) | |
z = property(...) | |
3D point with double-precision coordinates.
Signature | Parameters | Description |
---|---|---|
MPoint() | Default constructor. Returns a new MPoint object, initialized to the origin. | |
MPoint(src) | src - MPoint, MFloatPoint, MVector or MFloatVector | Copy constructor. Returns a new MPoint object with its x, y, z and w coords set to the same values as src. If src is a vector then the new MPoint's w coordinate is set to 1.0. |
MPoint(seq) | seq - sequence of two, three or four floats | Returns a new MPoint object whose x, y, z and w coordinates are set to the elements of seq. If the sequence contains fewer than four values w will be set to 1.0. If the sequence contains fewer than three values z will be set to 0.0. |
MPoint(x, y, z=0.0, w=1.0) | x - float y - float z - float w - float | Returns a new MPoint object with the specified x, y, z and w coordinates. |
An MPoint is treated a sequence of four float values: [x, y, z, w].
len() returns 4.
Indexing and element assignment are supported.
Deletion, concatenation, repetition and slicing are not supported.
Operation | Description |
---|---|
MPoint = MPoint + MVector | Addition of a vector to a point. |
MPoint += MVector | In-place addition of a vector to the point. Returns a new reference to the point. |
MPoint = MPoint - MVector | Subtraction of a vector from a point. |
MPoint -= MVector | In-place subtraction of a vector from a point. Returns a new reference to the point. |
MVector = MPoint - MPoint | Vector difference between two points. |
MPoint = MMatrix* MPoint | Pre-multiplication of a point by a matrix. |
MPoint = MPoint * MMatrix | Post-multiplication of a point by a matrix. |
MPoint *= MMatrix | In-place post-multiplication of a point by a matrix. Returns a new reference to the point. |
MPoint = MPoint * scalar | Multiplication of a point by a scalar. The scalar must be convertable to float. |
MPoint = MPoint / scalar | Division of a point by a scalar. The scalar must be convertable to float. |
MPoint == MPoint | Returns True if each component of the first point is exactly equal to the corresponding component of the second. |
MPoint != MPoint | Returns False is any component of the first point is not exactly equal to the corresponding component of the second. |
All other comparison operators will raise a TypeError exception.
def OpenMaya.MPoint.__init__ | ( | ) |
Initialize self. See help(type(self)) for accurate signature.
def OpenMaya.MPoint.__add__ | ( | ) |
Return self+value.
def OpenMaya.MPoint.__delitem__ | ( | ) |
Delete self[key].
def OpenMaya.MPoint.__eq__ | ( | ) |
Return self==value.
def OpenMaya.MPoint.__ge__ | ( | ) |
Return self>=value.
def OpenMaya.MPoint.__getitem__ | ( | ) |
Return self[key].
def OpenMaya.MPoint.__gt__ | ( | ) |
Return self>value.
def OpenMaya.MPoint.__iadd__ | ( | ) |
Return self+=value.
def OpenMaya.MPoint.__imul__ | ( | ) |
Return self*=value.
def OpenMaya.MPoint.__isub__ | ( | ) |
Return self-=value.
def OpenMaya.MPoint.__le__ | ( | ) |
Return self<=value.
def OpenMaya.MPoint.__len__ | ( | ) |
Return len(self).
def OpenMaya.MPoint.__lt__ | ( | ) |
Return self<value.
def OpenMaya.MPoint.__mul__ | ( | ) |
Return self*value.
def OpenMaya.MPoint.__ne__ | ( | ) |
Return self!=value.
|
static |
Create and return a new object. See help(type) for accurate signature.
def OpenMaya.MPoint.__radd__ | ( | ) |
Return value+self.
def OpenMaya.MPoint.__repr__ | ( | ) |
Return repr(self).
def OpenMaya.MPoint.__rmul__ | ( | ) |
Return value*self.
def OpenMaya.MPoint.__rsub__ | ( | ) |
Return value-self.
def OpenMaya.MPoint.__rtruediv__ | ( | ) |
Return value/self.
def OpenMaya.MPoint.__setitem__ | ( | ) |
Set self[key] to value.
def OpenMaya.MPoint.__str__ | ( | ) |
Return str(self).
def OpenMaya.MPoint.__sub__ | ( | ) |
Return self-value.
def OpenMaya.MPoint.__truediv__ | ( | ) |
Return self/value.
OpenMaya.MPoint.cartesianize | ( | ) |
Convert point to cartesian form.
Signature: | cartesianize() |
Parameters: | |
Returns: | Reference to self. |
Description: | Converts this point to cartesian form. |
OpenMaya.MPoint.distanceTo | ( | ) |
Return distance between this point and another.
Signature: | distanceTo(other) |
Parameters: | other - MPoint |
Returns: | float |
Description: | Returns the distance between this point and other. |
OpenMaya.MPoint.homogenize | ( | ) |
Convert point to homogenous form.
Signature: | homogenize() |
Parameters: | |
Returns: | Reference to self. |
Description: | Converts this point to homogenous form. |
OpenMaya.MPoint.isEquivalent | ( | ) |
Test for equivalence of two points, within a tolerance.
Signature: | isEquivalent(other, tol=kTolerance) |
Parameters: | other - MPoint tol - float |
Returns: | Bool |
Description: | Returns True if the coordinates of this point and other are equal to within a tolerance of tol. |
OpenMaya.MPoint.rationalize | ( | ) |
Convert point to rational form.
Signature: | rationalize() |
Parameters: | |
Returns: | Reference to self. |
Description: | Converts this point to rational form. |
|
static |
Name: | kOrigin |
Type: | MPoint |
Description: | (0, 0, 0, 1) |
|
static |
Name: | kTolerance |
Type: | float |
Description: | Default tolerance used for inexact comparisons. |
|
static |
W coordinate
Name: | w |
Type: | float |
Access: | RW |
Description: | W coordinate |
|
static |
X coordinate
Name: | x |
Type: | float |
Access: | RW |
Description: | X coordinate |
|
static |
Y coordinate
Name: | y |
Type: | float |
Access: | RW |
Description: | Y coordinate |
|
static |
Z coordinate
Name: | z |
Type: | float |
Access: | RW |
Description: | Z coordinate |