Python API 2.0 Reference
|
Static Public Member Functions | |
def | __new__ () |
Static Public Member Functions inherited from OpenMaya.MFnDagNode | |
def | __new__ () |
Static Public Member Functions inherited from OpenMaya.MFnDependencyNode | |
def | __new__ () |
def | allocateFlag () |
def | classification () |
def | deallocateAllFlags () |
def | deallocateFlag () |
Static Public Member Functions inherited from OpenMaya.MFnBase | |
def | __new__ () |
Additional Inherited Members | |
Properties inherited from OpenMaya.MFnDagNode | |
boundingBox = property(...) | |
inModel = property(...) | |
inUnderWorld = property(...) | |
isInstanceable = property(...) | |
isIntermediateObject = property(...) | |
objectColor = property(...) | |
objectColorRGB = property(...) | |
objectColorType = property(...) | |
useObjectColor = property(...) | |
Properties inherited from OpenMaya.MFnDependencyNode | |
isDefaultNode = property(...) | |
isFromReferencedFile = property(...) | |
isLocked = property(...) | |
isShared = property(...) | |
namespace = property(...) | |
pluginName = property(...) | |
typeId = property(...) | |
typeName = property(...) | |
Function set for operation on meshes (polygonal surfaces). __init__() Initializes a new, empty MFnMesh object. __init__(MDagPath path) Initializes a new MFnMesh object and attaches it to the DAG path of a mesh node. __init__(MObject nodeOrData) Initializes a new MFnMesh object and attaches it to a mesh node or mesh data object. Method resolution order: - MFnMesh - MFnDagNode - MFnDependencyNode - MFnBase - builtins.object
Signature | Parameters | Description | ||
---|---|---|---|---|
Name | Type | Description | ||
MFnMesh() | Default constructor. Returns a new MFnMesh functionset with no Maya object attached. | |||
MFnMesh(mesh) | mesh | MObject | Mesh node or mesh geometry data. | Returns a new MFnMesh object attached to the given mesh node or mesh geometry data. |
Only available in Maya 2012 HotFix 1 or later: | ||||
MFnMesh(path) | path | MDagPath | Dag path of a mesh node. | Returns a new MFnMesh object attached to the given mesh node. |
Default.
Default.
def OpenMaya.MFnMesh.__init__ | ( | ) |
Initialize self. See help(type(self)) for accurate signature.
|
static |
Create and return a new object. See help(type) for accurate signature.
def OpenMaya.MFnMesh.addHoles | ( | ) |
addHoles(faceIndex, vertices, loopCounts, mergeVertices=True, pointTolerance=kPointTolerance) -> self Adds holes to a mesh polygon. loopCounts is an array of vertex counts. The first entry gives the count of vertices that make up the first hole to add to the polygon (using that many entries in vertexArray). The following entries in loopCounts give the count of vertices that make up each remaining hole, using the following entries in vertexArray. Therefore the sum of the entries of loopCounts should equal the total length of vertexArray. Note that holes should normally be specified with the opposite winding order to the exterior polygon.
OpenMaya.MFnMesh.addPolygon | ( | ) |
addPolygon(vertices, mergeVertices=True, pointTolerance=kPointTolerance, loopCounts=None) -> faceId Adds a new polygon to the mesh, returning the index of the new polygon. If mergeVertices is True and a new vertex is within pointTolerance of an existing one, then they are 'merged' by reusing the existing vertex and discarding the new one. loopCounts allows for polygons with holes. If supplied, it is an array of integer vertex counts. The first entry gives the count of vertices that make up the exterior of the polygon (using that many entries in vertexArray). The following entries in loopCounts give the count of vertices that make up each hole, using the following entries in vertexArray. Therefore the sum of the entries of loopCounts should equal the total length of vertexArray. Note that holes should normally be specified with the opposite winding order to the exterior polygon.
Signature: | addPolygon(vertices, mergeVertices=True, pointTolerance=kPointTolerance) | ||||||||||||
Parameters: |
| ||||||||||||
Returns: | int | ||||||||||||
Description: | Adds a new polygon to the mesh, returning the index of the new polygon. If mergeVertices is True and a new vertex is within pointTolerance of an existing one, then they are "merged" by reusing the existing vertex and discarding the new one. |
OpenMaya.MFnMesh.allIntersections | ( | ) |
allIntersections(raySource, rayDirection, space, maxParam, testBothDirections, faceIds=None, triIds=None, idsSorted=False, accelParams=None, tolerance=kIntersectTolerance, sortHits=False) -> (hitPoints, hitRayParams, hitFaces, hitTriangles, hitBary1s, hitBary2s) Finds all intersection of a ray starting at raySource and travelling in rayDirection with the mesh. If faceIds is specified, then only those faces will be considered for intersection. If both faceIds and triIds are given, then the triIds will be interpreted as face-relative and each pair of entries will be taken as a (face, triangle) pair to be considered for intersection. Thus, the face-triangle pair (10, 0) means the first triangle on face 10. If neither faceIds nor triIds is given, then all face-triangles in the mesh will be considered. The maxParam and testBothDirections flags can be used to control the radius of the search around the raySource point. The search proceeds by testing all applicable face-triangles looking for intersections. If the accelParams parameter is given then the mesh builds an intersection acceleration structure based on it. This acceleration structure is used to speed up the intersection operation, sometimes by a factor of several hundred over the non- accelerated case. Once created, the acceleration structure is cached and will be reused the next time this method (or anyIntersection() or allIntersections()) is called with an identically-configured MMeshIsectAccelParams object. If a different MMeshIsectAccelParams object is used, then the acceleration structure will be deleted and re-created according to the new settings. Once created, the acceleration structure will persist until either the object is destroyed (or rebuilt by a construction history operation), or the freeCachedIntersectionAccelerator() method is called. The cachedIntersectionAcceleratorInfo() and globalIntersectionAcceleratorsInfo() methods provide useful information about the resource usage of individual acceleration structures, and of all such structures in the system. If the ray hits the mesh, the details of the intersection points will be returned as a tuple containing the following: * hitPoints (MFloatPointArray) - coordinates of the points hit, in the space specified by the caller.* hitRayParams (MFloatArray) - parametric distances along the ray to the points hit.* hitFaces (MIntArray) - IDs of the faces hit * hitTriangles (MIntArray) - face-relative IDs of the triangles hit * hitBary1s (MFloatArray) - first barycentric coordinate of the points hit. If the vertices of the hitTriangle are (v1, v2, v3) then the barycentric coordinates are such that the hitPoint = (*hitBary1)*v1 + (*hitBary2)*v2 + (1-*hitBary1-*hitBary2)*v3.* hitBary2s (MFloatArray) - second barycentric coordinate of the points hit. If no point was hit then the arrays will all be empty.
Signature: | allIntersections(raySource, rayDirection, space, maxParam, testBothDirections, faceIds=None, triIds=None, idsSorted=False, accelParams=None, tolerance=kIntersectTolerance, sortHits=False) | ||||||||||||||||||||||||||||||||||||
Parameters: |
| ||||||||||||||||||||||||||||||||||||
Returns: | (hitPoints, hitRayParams, hitFaces, hitTriangles, hitBary1s, hitBay2s) | ||||||||||||||||||||||||||||||||||||
Description: | Finds all intersection of a ray starting at raySource and travelling in rayDirection with the mesh. If faceIds is specified, then only those faces will be considered for intersection. If both faceIds and triIds are given, then the triIds will be interpreted as face-relative and each pair of entries will be taken as a (face,triangle) pair to be considered for intersection. Thus, the face-triangle pair (10,0) means the first triangle on face 10. If neither faceIds nor triIds is given, then all face-triangles in the mesh will be considered. The maxParam and testBothDirections flags can be used to control the radius of the search around the raySource point. The search proceeds by testing all applicable face-triangles looking for intersections. If the accelParams parameter is given then the mesh builds an intersection acceleration structure based on it. This acceleration structure is used to speed up the intersection operation, sometimes by a factor of several hundred over the non-accelerated case. Once created, the acceleration structure is cached, and will be reused the next time this method (or anyIntersection() or allIntersections()) is called with an identically-configured MMeshIsectAccelParams object. If a different MMeshIsectAccelParams object is used, then the acceleration structure will be deleted and re-created according to the new settings. Once created, the acceleration structure will persist until either the object is destroyed (or rebuilt by a construction history operation), or the freeCachedIntersectionAccelerator() method is called. The cachedIntersectionAcceleratorInfo() and globalIntersectionAcceleratorsInfo() methods provide useful information about the resource usage of individual acceleration structures, and of all such structures in the system. If the ray hits the mesh, the details of the intersection points will be returned as a tuple containing the following:
If no point was hit then the arrays will all be empty. |
OpenMaya.MFnMesh.anyIntersection | ( | ) |
anyIntersection(raySource, rayDirection, space, maxParam, testBothDirections, faceIds=None, triIds=None, idsSorted=False, accelParams=None, tolerance=kIntersectTolerance) -> (hitPoint, hitRayParam, hitFace, hitTriangle, hitBary1, hitBary2) Finds any intersection of a ray starting at raySource and travelling in rayDirection with the mesh. If faceIds is specified, then only those faces will be considered for intersection. If both faceIds and triIds are given, then the triIds will be interpreted as face-relative and each pair of entries will be taken as a (face, triangle) pair to be considered for intersection. Thus, the face-triangle pair (10, 0) means the first triangle on face 10. If neither faceIds nor triIds is given, then all face-triangles in the mesh will be considered. The maxParam and testBothDirections flags can be used to control the radius of the search around the raySource point. The search proceeds by testing all applicable face-triangles looking for intersections. If the accelParams parameter is given then the mesh builds an intersection acceleration structure based on it. This acceleration structure is used to speed up the intersection operation, sometimes by a factor of several hundred over the non- accelerated case. Once created, the acceleration structure is cached and will be reused the next time this method (or anyIntersection() or allIntersections()) is called with an identically-configured MMeshIsectAccelParams object. If a different MMeshIsectAccelParams object is used, then the acceleration structure will be deleted and re-created according to the new settings. Once created, the acceleration structure will persist until either the object is destroyed (or rebuilt by a construction history operation), or the freeCachedIntersectionAccelerator() method is called. The cachedIntersectionAcceleratorInfo() and globalIntersectionAcceleratorsInfo() methods provide useful information about the resource usage of individual acceleration structures, and of all such structures in the system. If the ray hits the mesh, the details of the intersection point will be returned as a tuple containing the following: * hitPoint (MFloatPoint) - coordinates of the point hit, in the space specified by the caller.* hitRayParam (float) - parametric distance along the ray to the point hit.* hitFace (int) - ID of the face hit * hitTriangle (int) - face-relative ID of the triangle hit * hitBary1 (float) - first barycentric coordinate of the point hit. If the vertices of the hitTriangle are (v1, v2, v3) then the barycentric coordinates are such that the hitPoint = (*hitBary1)*v1 + (*hitBary2)*v2 + (1-*hitBary1-*hitBary2)*v3.* hitBary2 (float) - second barycentric coordinate of the point hit. If no point was hit then the arrays will all be empty.
Signature: | anyIntersection(raySource, rayDirection, space, maxParam, testBothDirections, faceIds=None, triIds=None, idsSorted=False, accelParams=None, tolerance=kIntersectTolerance) | |||||||||||||||||||||||||||||||||
Parameters: |
| |||||||||||||||||||||||||||||||||
Returns: | (hitPoint, hitRayParam, hitFace, hitTriangle, hitBary1, hitBay2) or None | |||||||||||||||||||||||||||||||||
Description: | Finds any intersection of a ray starting at raySource and travelling in rayDirection with the mesh. If faceIds is specified, then only those faces will be considered for intersection. If both faceIds and triIds are given, then the triIds will be interpreted as face-relative and each pair of entries will be taken as a (face,triangle) pair to be considered for intersection. Thus, the face-triangle pair (10,0) means the first triangle on face 10. If neither faceIds nor triIds is given, then all face-triangles in the mesh will be considered. The maxParam and testBothDirections flags can be used to control the radius of the search around the raySource point. The search proceeds by testing all applicable face-triangles looking for intersections. If the accelParams parameter is given then the mesh builds an intersection acceleration structure based on it. This acceleration structure is used to speed up the intersection operation, sometimes by a factor of several hundred over the non-accelerated case. Once created, the acceleration structure is cached, and will be reused the next time this method (or anyIntersection() or allIntersections()) is called with an identically-configured MMeshIsectAccelParams object. If a different MMeshIsectAccelParams object is used, then the acceleration structure will be deleted and re-created according to the new settings. Once created, the acceleration structure will persist until either the object is destroyed (or rebuilt by a construction history operation), or the freeCachedIntersectionAccelerator() method is called. The cachedIntersectionAcceleratorInfo() and globalIntersectionAcceleratorsInfo() methods provide useful information about the resource usage of individual acceleration structures, and of all such structures in the system. If the ray hits the mesh, the details of the intersection point will be returned as a tuple containing the following:
If no point was hit then None will be returned. |
OpenMaya.MFnMesh.assignColor | ( | ) |
assignColor(faceId, vertexIndex, colorId, colorSet='') -> self Assigns a color from a colorSet to a specified vertex of a face.
Signature: | assignColor(faceId, vertexIndex, colorId, colorSet='') | |||||||||||||||
Parameters: |
| |||||||||||||||
Returns: | Reference to self | |||||||||||||||
Description: | Assigns a color from a colorSet to a specified vertex of a face. |
OpenMaya.MFnMesh.assignColors | ( | ) |
assignColors(colorIds, colorSet=') -> self Assigns colors to all of the mesh's face-vertices. The colorIds sequence must contain an entry for every vertex of every face, in face order, meaning that the entries for all the vertices of face 0 come first, followed by the entries for the vertices of face 1, etc.
Signature: | assignColors(colorIds, colorSet='') | |||||||||
Parameters: |
| |||||||||
Returns: | Reference to self | |||||||||
Description: | Assigns colors to all of the mesh's face-vertices. The colorIds sequence must contain an entry for every vertex of every face, in face order, meaning that the entries for all the vertices of face 0 come first, followed by the entries for the vertices of face 1, etc. |
OpenMaya.MFnMesh.assignUV | ( | ) |
assignUV(faceId, vertexIndex, uvId, uvSet='') -> self Assigns a UV coordinate from a uvSet to a specified vertex of a face.
Signature: | assignUV(faceId, vertexIndex, uvId, uvSet='') | |||||||||||||||
Parameters: |
| |||||||||||||||
Returns: | Reference to self | |||||||||||||||
Description: | Assigns a UV coordinate to a specified vertex of a polygon. |
OpenMaya.MFnMesh.assignUVs | ( | ) |
assignUVs(uvCounts, uvIds, uvSet='') -> self Assigns UV coordinates to the mesh's face-vertices. uvCounts contains the number of UVs to assign for each of the mesh's faces. That number must equal the number of vertices in the corresponding face or be 0 to indicate that no UVs will be assigned to that face.
Signature: | assignUVs(uvCounts, uvIds, uvSet='') | ||||||||||||
Parameters: |
| ||||||||||||
Returns: | Reference to self | ||||||||||||
Description: | Assigns UV coordinates to the mesh's face-vertices. |
|
static |
autoUniformGridParams() -> MMeshIsectAccelParams Creates an object which specifies a uniform voxel grid structure which can be used by the intersection routines to speed up their operation. The number of voxel cells to use will be determined automatically based on the density of triangles in the mesh. The grid acceleration structure will be cached with the mesh, so that if the same MMeshIsectAccelParams configuration is used on the next intersect call, the acceleration structure will not need to be rebuilt.
Signature: | autoUniformGridParams() |
Parameters: | None. |
Returns: | MMeshIsectAccelParams |
Description: | Creates an object which specifies a uniform voxel grid structure which can be used by the intersection routines to speed up their operation. The number of voxel cells to use will be determined automatically based on the density of triangles in the mesh. The grid acceleration structure will be cached with the mesh, so that if the same MMeshIsectAccelParams configuration is used on the next intersect call, the acceleration structure will not need to be rebuilt. |
OpenMaya.MFnMesh.booleanOp | ( | ) |
(Deprecated: Please use booleanOps instead) booleanOp(Boolean Operation constant, MFnMesh, MFnMesh) -> self Replaces this mesh's geometry with the result of a boolean operation on the two specified meshes.
Signature: | booleanOp(op, mesh1, mesh2) | ||||||||||||
Parameters: |
| ||||||||||||
Returns: | Reference to self | ||||||||||||
Description: | Replaces this mesh's geometry with the result of a boolean operation on the two specified meshes. |
def OpenMaya.MFnMesh.booleanOps | ( | ) |
booleanOps(Boolean Operation constant, MObjectArray, bool) -> self Replaces this mesh's geometry with the result of a boolean operation on the specified meshes.
OpenMaya.MFnMesh.cachedIntersectionAcceleratorInfo | ( | ) |
cachedIntersectionAcceleratorInfo() -> string Retrieves a string that describes the intersection acceleration structure for this object, if any. The string will be of the following form: 10x10x10 uniform grid, (build time 0.5s), (memory footprint 2000KB) It describes the configuration of the cached intersection accelerator, as well as how long it took to build it, and how much memory it is currently occupying. If the mesh has no cached intersection accelerator, the empty string is returned.
Signature: | cachedIntersectionAcceleratorInfo() |
Parameters: | None. |
Returns: | string |
Description: | Retrieves a string that describes the intersection acceleration structure for this object, if any. The string will be of the following form: 10x10x10 uniform grid, (build time 0.5s), (memory footprint 2000KB) It describes the configuration of the cached intersection accelerator, as well as how long it took to build it, and how much memory it is currently occupying. If the mesh has no cached intersection accelerator, the empty string is returned. |
OpenMaya.MFnMesh.cleanupEdgeSmoothing | ( | ) |
cleanupEdgeSmoothing() -> self Updates the mesh after setEdgeSmoothing has been done. This should be called only once, after all the desired edges have been had their smoothing set. If you don't call this method, the normals may not be correct, and the object will look odd in shaded mode.
Signature: | cleanupEdgeSmoothing() |
Parameters: | None. |
Returns: | Reference to self |
Description: | Updates the mesh after setEdgeSmoothing has been done. This should be called only once, after all the desired edges have been had their smoothing set. If you don't call this method, the normals may not be correct, and the object will look odd in shaded mode |
OpenMaya.MFnMesh.clearBlindData | ( | ) |
clearBlindData(compType) -> self clearBlindData(compType, blindDataId, compId=None, attr='') -> self The first version deletes all blind data from all the mesh's components of the given type (an MFn Type constant). The second version deletes values of the specified blind data type from the mesh's components of a given type. If a component ID is provided then the data is only deleted from that component, otherwise it is deleted from all of the mesh's components of the specified type. If a blind data attribute name is provided then only data for that attribute is deleted, otherwise data for all of the blind data type's attributes is deleted.
Signature: | clearBlindData(compType) | ||||||
Parameters: |
| ||||||
Returns: | Reference to self | ||||||
Description: | Deletes all blind data from all the mesh's components of a given type. |
Signature: | clearBlindData(compType, blindDataId, compId=None, attr='') | |||||||||||||||
Parameters: |
| |||||||||||||||
Returns: | Reference to self | |||||||||||||||
Description: | Deletes values of the specified blind data type from the mesh's components of a given type. If a component ID is provided then the data is only deleted from that component, otherwise it is deleted from all of the mesh's components of the specified type. If a blind data attribute name is provided then only data for that attribute is deleted, otherwise data for all of the blind data type's attributes is deleted. |
OpenMaya.MFnMesh.clearColors | ( | ) |
clearColors(colorSet='') -> self Clears out all colors from a colorSet, and leaves behind an empty colorset. This method should be used if it is needed to shrink the actual size of the color set. In this case, the user should call clearColors(), setColors() and then assignColors() to rebuild the mapping info. When called on mesh data, the colors are removed. When called on a shape with no history, the colors are removed and the attributes are set on the shape. When called on a shape with history, the polyColorDel command is invoked and a polyColorDel node is created. If no colorSet is specified the mesh's current color set will be used.
Signature: | clearColors(colorSet='') | ||||||
Parameters: |
| ||||||
Returns: | Reference to self | ||||||
Description: | Clears out all colors from a colorSet, and leaves behind an empty colorset. This method should be used if it is needed to shrink the actual size of the color set. In this case, the user should call clearColors(), setColors() and then assignColors() to rebuild the mapping info. When called on mesh data, the colors are removed. When called on a shape with no history, the colors are removed and the attributes are set on the shape. When called on a shape with history, the polyColorDel command is invoked and a polyColorDel node is created. |
|
static |
clearGlobalIntersectionAcceleratorInfo() Clears the 'total count', 'total build time', and 'peak memory' fields from the information string returned by globalIntersectionAcceleratorsInfo(). It will not cause information about currently existing accelerators to be lost.
Signature: | clearGlobalIntersectionAcceleratorInfo() |
Parameters: | None. |
Returns: | |
Description: | Clears the "total count", "total build time", and "peak memory" fields from the information string returned by globalIntersectionAcceleratorsInfo(). It will not cause information about currently existing accelerators to be lost. |
OpenMaya.MFnMesh.clearUVs | ( | ) |
clearUVs(uvSet='') -> self Clears out all uvs from a uvSet, and leaves behind an empty uvset. This method should be used if it is needed to shrink the actual size of the uv set. In this case, the user should call clearUVs(), setUVs() and then assignUVs() to rebuild the mapping info. When called on mesh data, the uvs are removed. When called on a shape with no history, the uvs are removed and the attributes are set on the shape. When called on a shape with history, the polyMapDel command is invoked and a polyMapDel node is created. If no uvSet is specified the mesh's current uv set will be used.
Signature: | clearUVs(uvSet='') | ||||||
Parameters: |
| ||||||
Returns: | Reference to self | ||||||
Description: | Clears out all texture coordinates from the mesh, and leaves behind an empty UVset. This method should be used if it is needed to shrink the actual size of the UV table. In this case, the user should call clearUVs(), setUVs() and then assignUVs() to rebuild the mapping info. When called on mesh data, the UVs are removed. When called on a shape with no history, the UVs are removed and the attributes are set on the shape. When called on a shape with history, the polyMapDel command is invoked and a polyMapDel node is created. |
OpenMaya.MFnMesh.closestIntersection | ( | ) |
closestIntersection(raySource, rayDirection, space, maxParam, testBothDirections, faceIds=None, triIds=None, idsSorted=False, accelParams=None, tolerance=kIntersectTolerance) -> (hitPoint, hitRayParam, hitFace, hitTriangle, hitBary1, hitBary2) Finds the closest intersection of a ray starting at raySource and travelling in rayDirection with the mesh. If faceIds is specified, then only those faces will be considered for intersection. If both faceIds and triIds are given, then the triIds will be interpreted as face-relative and each pair of entries will be taken as a (face, triangle) pair to be considered for intersection. Thus, the face-triangle pair (10, 0) means the first triangle on face 10. If neither faceIds nor triIds is given, then all face-triangles in the mesh will be considered. The maxParam and testBothDirections flags can be used to control the radius of the search around the raySource point. The search proceeds by testing all applicable face-triangles looking for intersections. If the accelParams parameter is given then the mesh builds an intersection acceleration structure based on it. This acceleration structure is used to speed up the intersection operation, sometimes by a factor of several hundred over the non- accelerated case. Once created, the acceleration structure is cached and will be reused the next time this method (or anyIntersection() or allIntersections()) is called with an identically-configured MMeshIsectAccelParams object. If a different MMeshIsectAccelParams object is used, then the acceleration structure will be deleted and re-created according to the new settings. Once created, the acceleration structure will persist until either the object is destroyed (or rebuilt by a construction history operation), or the freeCachedIntersectionAccelerator() method is called. The cachedIntersectionAcceleratorInfo() and globalIntersectionAcceleratorsInfo() methods provide useful information about the resource usage of individual acceleration structures, and of all such structures in the system. If the ray hits the mesh, the details of the intersection point will be returned as a tuple containing the following: * hitPoint (MFloatPoint) - coordinates of the point hit, in the space specified by the caller.* hitRayParam (float) - parametric distance along the ray to the point hit.* hitFace (int) - ID of the face hit * hitTriangle (int) - face-relative ID of the triangle hit * hitBary1 (float) - first barycentric coordinate of the point hit. If the vertices of the hitTriangle are (v1, v2, v3) then the barycentric coordinates are such that the hitPoint = (*hitBary1)*v1 + (*hitBary2)*v2 + (1-*hitBary1-*hitBary2)*v3.* hitBary2 (float) - second barycentric coordinate of the point hit. If no point was hit then the arrays will all be empty.
Signature: | closestIntersection(raySource, rayDirection, space, maxParam, testBothDirections, faceIds=None, triIds=None, idsSorted=False, accelParams=None, tolerance=kIntersectTolerance) | |||||||||||||||||||||||||||||||||
Parameters: |
| |||||||||||||||||||||||||||||||||
Returns: | (hitPoint, hitRayParam, hitFace, hitTriangle, hitBary1, hitBay2) or None | |||||||||||||||||||||||||||||||||
Description: | Finds the closest intersection of a ray starting at raySource and travelling in rayDirection with the mesh. If faceIds is specified, then only those faces will be considered for intersection. If both faceIds and triIds are given, then the triIds will be interpreted as face-relative and each pair of entries will be taken as a (face,triangle) pair to be considered for intersection. Thus, the face-triangle pair (10,0) means the first triangle on face 10. If neither faceIds nor triIds is given, then all face-triangles in the mesh will be considered. The maxParam and testBothDirections flags can be used to control the radius of the search around the raySource point. The search proceeds by testing all applicable face-triangles looking for intersections. If the accelParams parameter is given then the mesh builds an intersection acceleration structure based on it. This acceleration structure is used to speed up the intersection operation, sometimes by a factor of several hundred over the non-accelerated case. Once created, the acceleration structure is cached, and will be reused the next time this method (or anyIntersection() or allIntersections()) is called with an identically-configured MMeshIsectAccelParams object. If a different MMeshIsectAccelParams object is used, then the acceleration structure will be deleted and re-created according to the new settings. Once created, the acceleration structure will persist until either the object is destroyed (or rebuilt by a construction history operation), or the freeCachedIntersectionAccelerator() method is called. The cachedIntersectionAcceleratorInfo() and globalIntersectionAcceleratorsInfo() methods provide useful information about the resource usage of individual acceleration structures, and of all such structures in the system. If the ray hits the mesh, the details of the closest intersection point to the raySource will be returned as a tuple containing the following:
If no point was hit then None will be returned. |
OpenMaya.MFnMesh.collapseEdges | ( | ) |
collapseEdges(seq of int) -> self Collapses edges into vertices. The two vertices that create each given edge are replaced in turn by one vertex placed at the average of the two initial vertex.
Signature: | collapseEdges(edges) | ||||||
Parameters: |
| ||||||
Returns: | Reference to self | ||||||
Description: | Collapses edges into vertices. The two vertices that create each given edge are replaced in turn by one vertex placed at the average of the two initial vertex. |
OpenMaya.MFnMesh.collapseFaces | ( | ) |
collapseFaces(seq of int) -> self Collapses faces into vertices. Adjacent faces will be collapsed together into a single vertex. Non-adjacent faces will be collapsed into their own, separate vertices.
Signature: | collapseFaces(faces) | ||||||
Parameters: |
| ||||||
Returns: | Reference to self | ||||||
Description: | Collapses faces into vertices. Adjacent faces will be collapsed together into a single vertex. Non-adjacent faces will be collapsed into their own, separate vertices. |
OpenMaya.MFnMesh.copy | ( | ) |
copy(MObject, parent=kNullObj) -> MObject Creates a new mesh with the same geometry as the source. Raises TypeError if the source is not a mesh node or mesh data object or it contains an empty mesh. If the parent is a kMeshData wrapper (e.g. from MFnMeshData.create()) then a mesh data object will be created and returned and the wrapper will be set to reference it. If the parent is a transform type node then a mesh node will be created and parented beneath it and the return value will be the mesh node. If the parent is any other type of node a TypeError will be raised. If no parent is provided then a transform node will be created and returned and a mesh node will be created and parented under the transform.
Signature: | copy(source, parent=kNullObj) | |||||||||
Parameters: |
| |||||||||
Returns: | MObject | |||||||||
Description: | Creates a new mesh with the same geometry as the source. Raises TypeError if the source is not a mesh node or mesh data object or it contains an empty mesh. If the parent is a kMeshData wrapper (e.g. from MFnMeshData.create() ) then a mesh data object will be created and returned and the wrapper will be set to reference it. If the parent is a transform type node then a mesh node will be created and parented beneath it and the return value will be the mesh node. If the parent is any other type of node a TypeError will be raised. If no parent is provided then a transform node will be created and returned and a mesh node will be created and parented under the transform. |
OpenMaya.MFnMesh.copyInPlace | ( | ) |
copyInPlace(MObject) -> self Replaces the current mesh's geometry with that from the source. Raises TypeError if the source is not a mesh node or mesh data object or it contains an empty mesh.
Signature: | copyInPlace(source) | ||||||
Parameters: |
| ||||||
Returns: | Reference to self. | ||||||
Description: | Replaces the current mesh's geometry with that from the source. Raises TypeError if the source is not a mesh node or mesh data object or it contains an empty mesh. |
OpenMaya.MFnMesh.copyUVSet | ( | ) |
copyUVSet(fromName, toName, modifier=None) -> string Copies the contents of one UV set into another. If the source UV set does not exist, or if it has the same name as the destination, then no copy will be made. If the destination UV set exists then its contents will be replace by a copy of the source UV set. If the destination UV set does not exist then a new UV set will be created and the source UV set will be copied into it. The name of the UV set will be that provided with a number appended to the end to ensure uniqueness. The final name of the destination UV set will be returned. This method is only valid for functionsets which are attached to mesh nodes, not mesh data.
Signature: | copyUVSet(fromName, toName, modifier=None) | ||||||||||||
Parameters: |
| ||||||||||||
Returns: | string | ||||||||||||
Description: | Copies the contents of one UV set into another. If the source UV set does not exist, or if it has the same name as the destination, then no copy will be made. If the destination UV set exists then its contents will be replace by a copy of the source UV set. If the destination UV set does not exist then a new UV set will be created and the source UV set will be copied into it. The name of the UV set will be that provided with a number appended to the end to ensure uniqueness. The final name of the destination UV set will be returned. This method is only valid for functionsets which are attached to mesh nodes, not mesh data. |
OpenMaya.MFnMesh.create | ( | ) |
create(vertices, polygonCounts, polygonConnects, uValues=None, vValues=None, parent=kNullObj) -> MObject create(vertices, edges, edgeConnectsCount, edgeFaceConnects, edgeFaceDesc, storeDoubles=False, parent=kNullObj) -> MObject Creates a new polygonal mesh and sets this function set to operate on it. This method is meant to be as efficient as possible and thus assumes that all the given data is topologically correct. If UV values are supplied both parameters must be given and they must contain the same number of values, otherwise IndexError will be raised. Note that the UVs are simply stored in the mesh, not assigned to any vertices. To assign them use assignUVs(). If the parent is a kMeshData wrapper (e.g. from MFnMeshData.create()) then a mesh data object will be created and returned and the wrapper will be set to reference it. If the parent is a transform type node then a mesh node will be created and parented beneath it and the return value will be the mesh node. If the parent is any other type of node a TypeError will be raised. If no parent is provided then a transform node will be created and returned and a mesh node will be created and parented under the transform.
Signature: | create(vertices, polygonCounts, polygonConnects, uValues=None, vValues=None, parent=kNullObj) | |||||||||||||||||||||
Parameters: |
| |||||||||||||||||||||
Returns: | MObject | |||||||||||||||||||||
Description: | Creates a new polygonal mesh and sets this function set to operate on it. This method is meant to be as efficient as possible and thus assumes that all the given data is topologically correct. If UV values are supplied both parameters must be given and they must contain the same number of values, otherwise IndexError will be raised. Note that the UVs are simply stored in the mesh, not assigned to any vertices. To assign them use assignUVs(). If the parent is a kMeshData wrapper (e.g. from MFnMeshData.create() ) then a mesh data object will be created and returned and the wrapper will be set to reference it. If the parent is a transform type node then a mesh node will be created and parented beneath it and the return value will be the mesh node. If the parent is any other type of node a TypeError will be raised. If no parent is provided then a transform node will be created and returned and a mesh node will be created and parented under the transform. |
OpenMaya.MFnMesh.createBlindDataType | ( | ) |
createBlindDataType(blindDataId, ((longName, shortName, typeName), ...)) -> self Create a new blind data type with the specified attributes. Each element of the attrs sequence is a tuple containing the long name, short name and type name of the attribute. Valid type names are 'int', 'float', 'double', 'boolean', 'string' or 'binary'. Raises RuntimeError if the blind data id is already in use or an invalid format was specified.
Signature: | createBlindDataType(blindDataId, attrs) | |||||||||
Parameters: |
| |||||||||
Returns: | Reference to self. | |||||||||
Description: | Create a new blind data type with the specified attributes. Each element of the attrs sequence is a tuple containing the long name, short name and type name of the attribute. Valid type names are "int", "float", "double", "boolean", "string" or "binary". Raises RuntimeError if the blind data id is already in use or an invalid format was specified. |
OpenMaya.MFnMesh.createColorSet | ( | ) |
createColorSet(name, clamped, rep=kRGBA, modifier=None, instances=None) -> string Creates a new, empty color set for this mesh. If no name is provided 'colorSet#' will be used, where # is a number that makes the name unique for this mesh. If a name is provided but it conflicts with that of an existing color set then a number will be appended to the proposed name to make it unique. The return value is the final name used for the new color set. This method will only work when the functionset is attached to a mesh node, not mesh data.
Signature: | createColorSet(name, clamped, rep=kRGBA, modifier=None, instances=None) | ||||||||||||||||||
Parameters: |
| ||||||||||||||||||
Returns: | string | ||||||||||||||||||
Description: | Creates a new, empty color set for this mesh. If no name is provided "colorSet#" will be used, where # is a number that makes the name unique for this mesh. If a name is provided but it conflicts with that of an existing color set then a number will be appended to the proposed name to make it unique. The return value is the final name used for the new color set. This method will only work when the functionset is attached to a mesh node, not mesh data. |
OpenMaya.MFnMesh.createInPlace | ( | ) |
createInPlace(vertices, polygonCounts, polygonConnects) -> self Replaces the existing polygonal mesh with a new one. This method is meant to be as efficient as possible and thus assumes that all the given data is topologically correct. The vertices may be given as a sequence of MFloatPoint's or a sequence of MPoint's, but not a mix of the two.
Signature: | createInPlace(vertices, polygonCounts, polygonConnects) | ||||||||||||
Parameters: |
| ||||||||||||
Returns: | Reference to self | ||||||||||||
Description: | Replaces the existing polygonal mesh with a new one. This method is meant to be as efficient as possible and thus assumes that all the given data is topologically correct. |
OpenMaya.MFnMesh.createUVSet | ( | ) |
createUVSet(name, modifier=None, instances=None) -> string Creates a new, empty UV set for this mesh. If a UV set with proposed name already exists then a number will be appended to the proposed name to name it unique. If the proposed name is empty then a name of the form uvSet# will be used where '#' is a number chosen to ensure that the name is unique. The name used for the UV set will be returned. This method is only valid for functionsets which are attached to mesh nodes, not mesh data.
Signature: | createUVSet(name, modifier=None, instances=None) | ||||||||||||
Parameters: |
| ||||||||||||
Returns: | string | ||||||||||||
Description: | Creates a new, empty UV set for this mesh. If a UV set with proposed name already exists then a number will be appended to the proposed name to name it unique. If the proposed name is empty then a name of the form uvSet# will be used where '#' is a number chosen to ensure that the name is unique. The name used for the UV set will be returned. This method is only valid for functionsets which are attached to mesh nodes, not mesh data. |
OpenMaya.MFnMesh.currentColorSetName | ( | ) |
currentColorSetName(instance=kInstanceUnspecified) -> string Get the name of the 'current' color set. The current color set is the one used for color operations when no color set is explicitly specified. On instanced meshes, color sets may be applied on a per-instance basis or may be shared across all instances. When the color sets are per-instance, the concept of the current color set has two levels of granularity. Namely, the current color set applies to one or more instances, plus there are other color sets in the same color set family that apply to different instances. The instance arguement is used to indicate that if this is a per-instance color set, you are interested in the name of the color set that applies to the specified instance. When the index is not specified, the current color set will be returned regardless of which instance it is for. If there is no current color set, then an empty string will be returned.
Signature: | currentColorSetName(instance=kInstanceUnspecified) | ||||||
Parameters: |
| ||||||
Returns: | string | ||||||
Description: | Get the name of the "current" color set. The current color set is the one used for color operations when no color set is explicitly specified. On instanced meshes, color sets may be applied on a per-instance basis or may be shared across all instances. When the color sets are per-instance, the concept of the current color set has two levels of granularity. Namely, the current color set applies to one or more instances, plus there are other color sets in the same color set family that apply to different instances. The instance arguement is used to indicate that if this is a per-instance color set, you are interested in the name of the color set that applies to the specified instance. When the index is not specified, the current color set will be returned regardless of which instance it is for. If there is no current color set, then an empty string will be returned. |
OpenMaya.MFnMesh.currentUVSetName | ( | ) |
currentUVSetName(instance=kInstanceUnspecified) -> string Get the name of the 'current' uv set. The current uv set is the one used for uv operations when no uv set is explicitly specified. On instanced meshes, uv sets may be applied on a per-instance basis or may be shared across all instances. When the uv sets are per-instance, the concept of the current uv set has two levels of granularity. Namely, the current uv set applies to one or more instances, plus there are other uv sets in the same uv set family that apply to different instances. The instance arguement is used to indicate that if this is a per-instance uv set, you are interested in the name of the uv set that applies to the specified instance. When the index is not specified, the current uv set will be returned regardless of which instance it is for. If there is no current uv set, then an empty string will be returned.
Signature: | currentUVSetName(instance=kInstanceUnspecified) | ||||||
Parameters: |
| ||||||
Returns: | string | ||||||
Description: | Get the name of the "current" uv set. The current uv set is the one used for uv operations when no uv set is explicitly specified. On instanced meshes, uv sets may be applied on a per-instance basis or may be shared across all instances. When the uv sets are per-instance, the concept of the current uv set has two levels of granularity. Namely, the current uv set applies to one or more instances, plus there are other uv sets in the same uv set family that apply to different instances. The instance arguement is used to indicate that if this is a per-instance uv set, you are interested in the name of the uv set that applies to the specified instance. When the index is not specified, the current uv set will be returned regardless of which instance it is for. If there is no current uv set, then an empty string will be returned. |
OpenMaya.MFnMesh.deleteColorSet | ( | ) |
deleteColorSet(colorSet, modifier=None, currentSelection=None) -> self Deletes a color set from the mesh. This method is only valid for functionsets which are attached to mesh nodes, not mesh data.
Signature: | deleteColorSet(colorSet, modifier=None, currentSelection=None) | ||||||||||||
Parameters: |
| ||||||||||||
Returns: | Reference to self | ||||||||||||
Description: | Deletes a color set from the mesh. This method is only valid for functionsets which are attached to mesh nodes, not mesh data. |
OpenMaya.MFnMesh.deleteEdge | ( | ) |
deleteEdge(edgeId, modifier=None) -> self Deletes the specified edge.
Signature: | deleteEdge(edgeId, modifier=None) | |||||||||
Parameters: |
| |||||||||
Returns: | Reference to self | |||||||||
Description: | Deletes the specified edge. |
OpenMaya.MFnMesh.deleteFace | ( | ) |
deleteFace(faceId, modifier=None) -> self Deletes the specified face.
Signature: | deleteFace(faceId, modifier=None) | |||||||||
Parameters: |
| |||||||||
Returns: | Reference to self | |||||||||
Description: | Deletes the specified face. |
OpenMaya.MFnMesh.deleteUVSet | ( | ) |
deleteUVSet(uvSet, modifier=None, currentSelection=None) -> self Deletes a uv set from the mesh. This method is only valid for functionsets which are attached to mesh nodes, not mesh data.
Signature: | deleteUVSet(uvSet, modifier=None, currentSelection=None) | ||||||||||||
Parameters: |
| ||||||||||||
Returns: | Reference to self | ||||||||||||
Description: | Deletes a named uv set from the mesh. This method is only valid for functionsets which are attached to mesh nodes, not mesh data. |
OpenMaya.MFnMesh.deleteVertex | ( | ) |
deleteVertex(vertexId, modifier=None) -> self Deletes the specified vertex.
Signature: | deleteVertex(vertexId, modifier=None) | |||||||||
Parameters: |
| |||||||||
Returns: | Reference to self | |||||||||
Description: | Deletes the specified vertex. |
OpenMaya.MFnMesh.duplicateFaces | ( | ) |
duplicateFaces(faces, translation=None) -> self Duplicates a set of faces and detaches them from the rest of the mesh. The resulting mesh will contain one more independant piece of geometry.
Signature: | duplicateFaces(faces, translation=None) | |||||||||
Parameters: |
| |||||||||
Returns: | Reference to self | |||||||||
Description: | Duplicates a set of faces and detaches them from the rest of the mesh. The resulting mesh will contain one more independant piece of geometry. |
OpenMaya.MFnMesh.extractFaces | ( | ) |
extractFaces(faces, translation=None) -> self Detaches a set of faces from the rest of the mesh. The resulting mesh will contain one more independant piece of geometry.
Signature: | extractFaces(faces, translation=None) | |||||||||
Parameters: |
| |||||||||
Returns: | Reference to self | |||||||||
Description: | Detaches a set of faces from the rest of the mesh. The resulting mesh will contain one more independant piece of geometry. |
OpenMaya.MFnMesh.extrudeEdges | ( | ) |
extrudeEdges(edges, extrusionCount=1, translation=None, extrudeTogether=True, thickness=0.0, offset=0.0) -> self Extrude the given edges along a vector. The resulting mesh will have extra parallelograms coming out of the given edges and going to the new extruded edges. The length of the new polygon is determined by the length of the vector. The extrusionCount parameter is the number of subsequent extrusions per edges and represents the number of polygons that will be created from each given edge to the extruded edges. The difference between using thickness or offset instead of providing a vector with the translation variable is that the translation will be applied to each vertex in the extrusion along its local direction. This can result in vertices being moved the same distance, but the angles between the original components are not maintained so the overall shape is not the same. Both the thickness and offset variables will attempt to move the components a distance that will maintain angles between edges at the border of the extrusion.
Signature: | extrudeEdges(edges, extrusionCount=1, translation=None, extrudeTogether=True) | |||||||||||||||
Parameters: |
| |||||||||||||||
Returns: | Reference to self | |||||||||||||||
Description: | Extrude the given edges along a vector. The resulting mesh will have extra parallelograms coming out of the given edges and going to the new extruded edges. The length of the new polygon is determined by the length of the vector. The extrusionCount parameter is the number of subsequent extrusions per edges and represents the number of polygons that will be created from each given edge to the extruded edges. |
OpenMaya.MFnMesh.extrudeFaces | ( | ) |
extrudeFaces(faces, extrusionCount=1, translation=None, extrudeTogether=True, thickness=0.0, offset=0.0) -> self Extrude the given faces along a vector. The resulting mesh will have extra parallelograms coming out of the given faces and going to the new extruded faces. The length of the new polygon is determined by the length of the vector. The extrusionCount parameter is the number of subsequent extrusions per faces and represents the number of polygons that will be created from each given face to the extruded faces. The difference between using thickness or offset instead of providing a vector with the translation variable is that the translation will be applied to each vertex in the extrusion along its local direction. This can result in vertices being moved the same distance, but the angles between the original components are not maintained so the overall shape is not the same. Both the thickness and offset variables will attempt to move the components a distance that will maintain angles between edges at the border of the extrusion.
Signature: | extrudeFaces(faces, extrusionCount=1, translation=None, extrudeTogether=True) | |||||||||||||||
Parameters: |
| |||||||||||||||
Returns: | Reference to self | |||||||||||||||
Description: | Extrude the given faces along a vector. The resulting mesh will have extra parallelograms coming out of the given faces and going to the new extruded faces. The length of the new polygon is determined by the length of the vector. The extrusionCount parameter is the number of subsequent extrusions per faces and represents the number of polygons that will be created from each given face to the extruded faces. |
OpenMaya.MFnMesh.freeCachedIntersectionAccelerator | ( | ) |
freeCachedIntersectionAccelerator() -> self If the mesh has a cached intersection accelerator structure, then this routine forces it to be deleted. Ordinarily, these structures are cached so that series of calls to the closestIntersection(), allIntersections(), and anyIntersection() methods can reuse the same structure. Once the client is finished with these intersection operations, however, they are responsible for freeing the acceleration structure, which is what this method does.
Signature: | freeCachedIntersectionAccelerator() |
Parameters: | None. |
Returns: | Reference to self |
Description: | If the mesh has a cached intersection accelerator structure, then this routine forces it to be deleted. Ordinarily, these structures are cached so that series of calls to the closestIntersection(), allIntersections(), and anyIntersection() methods can reuse the same structure. Once the client is finished with these intersection operations, however, they are responsible for freeing the acceleration structure, which is what this method does. |
OpenMaya.MFnMesh.generateSmoothMesh | ( | ) |
generateSmoothMesh(parent=kNullObj, options=None) -> MObject Creates a new polygonal mesh which is a smoothed version of the one to which the functionset is attached. If an options object is supplied it will be used to direct the smoothing operation, otherwise the mesh's Smooth Mesh Preview attributes will be used. If the parent is a kMeshData wrapper (e.g. from MFnMeshData.create()) then a mesh data object will be created and returned. If the parent is a transform type node then a mesh node will be created and parented beneath it and the return value will be the mesh node. If the parent is any other type of node a TypeError will be raised. If no parent is provided then a transform node will be created and returned and a mesh node will be created and parented under the transform. Note that, unlike the create functions, this function does not set the functionset to operate on the new mesh, but leaves it attached to the original mesh.
Signature: | generateSmoothMesh(parent=kNullObj, options=None) | |||||||||
Parameters: |
| |||||||||
Returns: | MObject | |||||||||
Description: | Creates a new polygonal mesh which is a smoothed version of the one to which the functionset is attached. If an options object is supplied it will be used to direct the smoothing operation, otherwise the mesh's Smooth Mesh Preview attributes will be used. If the parent is a kMeshData wrapper (e.g. from MFnMeshData.create() ) then a mesh data object will be created and returned. If the parent is a transform type node then a mesh node will be created and parented beneath it and the return value will be the mesh node. If the parent is any other type of node a TypeError will be raised. If no parent is provided then a transform node will be created and returned and a mesh node will be created and parented under the transform. Note that, unlike the create functions, this function does not set the functionset to operate on the new mesh, but leaves it attached to the original mesh. |
OpenMaya.MFnMesh.getAssignedUVs | ( | ) |
getAssignedUVs(uvSet='') -> (counts, uvIds) Returns a tuple containing all of the UV assignments for the specified UV set. The first element of the tuple is an array of counts giving the number of UVs assigned to each face of the mesh. The count will either be zero, indicating that that face's vertices do not have UVs assigned, or else it will equal the number of the face's vertices. The second element of the tuple is an array of UV IDs for all of the face-vertices which have UVs assigned.
Signature: | getAssignedUVs(uvSet='') | ||||||
Parameters: |
| ||||||
Returns: | (MIntArray, MIntArray) | ||||||
Description: | Returns a tuple containing all of the UV assignments for the specified UV set. The first element of the tuple is an array of counts giving the number of UVs assigned to each face of the mesh. The count will either be zero, indicating that that face's vertices do not have UVs assigned, or else it will equal the number of the face's vertices. The second element of the tuple is an array of UV IDs for all of the face-vertices which have UVs assigned. |
OpenMaya.MFnMesh.getAssociatedColorSetInstances | ( | ) |
getAssociatedColorSetInstances(colorSet) -> MIntArray Returns the instance numbers associated with the specified Color set. If the color map is shared across all instances, an empty array will be returned. This method will only work if the functionset is attached to a mesh node. It will raise RuntimeError if the functionset is attached to mesh data.
Signature: | getAssociatedColorSetInstances(colorSet) | ||||||
Parameters: |
| ||||||
Returns: | MIntArray | ||||||
Description: | Returns the instance numbers associated with the specified Color set. If the color map is shared across all instances, an empty array will be returned. This method will only work if the functionset is attached to a mesh node. It will raise RuntimeError if the functionset is attached to mesh data. |
OpenMaya.MFnMesh.getAssociatedUVSetInstances | ( | ) |
getAssociatedUVSetInstances(uvSet) -> MIntArray Returns the instance numbers associated with the specified UV set. If the uv map is shared across all instances, an empty array will be returned. This method will only work if the functionset is attached to a mesh node. It will raise RuntimeError if the functionset is attached to mesh data.
Signature: | getAssociatedUVSetInstances(uvSet) | ||||||
Parameters: |
| ||||||
Returns: | MIntArray | ||||||
Description: | Returns the instance numbers associated with the specified UV set. If the uv map is shared across all instances, an empty array will be returned. This method will only work if the functionset is attached to a mesh node. It will raise RuntimeError if the functionset is attached to mesh data. |
OpenMaya.MFnMesh.getAssociatedUVSetTextures | ( | ) |
getAssociatedUVSetTextures(uvSet) -> MObjectArray Returns the texture nodes which are using the specified UV set. If the texture has a 2d texture placement, the texture, and not the placement will be returned. This method will only work if the functionset is attached to a mesh node. It will raise RuntimeError if the functionset is attached to mesh data.
Signature: | getAssociatedUVSetTextures(uvSet) | ||||||
Parameters: |
| ||||||
Returns: | MObjectArray | ||||||
Description: | Returns the texture nodes which are using the specified UV set. If the texture has a 2d texture placement, the texture, and not the placement will be returned. This method will only work if the functionset is attached to a mesh node. It will raise RuntimeError if the functionset is attached to mesh data. |
OpenMaya.MFnMesh.getBinaryBlindData | ( | ) |
getBinaryBlindData(compId, compType, blindDataId, attr) -> string getBinaryBlindData(compType, blindDataId, attr) -> (MIntArray, [string, string, ...]) The first version returns the value of the specified blind data attribute from the specified mesh component. The second version returns a tuple containing an array of component IDs and an array of values for the specified blind data attribute for all of the mesh's components of the specified type. Both versions raise RuntimeError if the attribute is not of 'binary' type.
Signature: | getBinaryBlindData(compId, compType, blindDataId, attr) | |||||||||||||||
Parameters: |
| |||||||||||||||
Returns: | string | |||||||||||||||
Description: | Returns the value of the specified blind data attribute from the specified mesh component. Raises RuntimeError if the attribute is not of "binary" type. |
Signature: | getBinaryBlindData(compType, blindDataId, attr) | ||||||||||||
Parameters: |
| ||||||||||||
Returns: | (MIntArray, [string, string, ...]) | ||||||||||||
Description: | Returns a tuple containing an array of component IDs and an array of values for the specified blind data attribute for all of the mesh's components of the specified type. Raises RuntimeError if the attribute is not of "binary" type. |
OpenMaya.MFnMesh.getBinormals | ( | ) |
getBinormals(space=MSpace.kObject, uvSet='') -> MFloatVectorArray Returns the binormal vectors for all face-vertices. This method is not threadsafe.
Signature: | getBinormals(space=MSpace.kObject, uvSet='') | |||||||||
Parameters: |
| |||||||||
Returns: | MFloatVectorArray | |||||||||
Description: | Returns the binormal vectors for all face vertices. This method is not threadsafe. |
OpenMaya.MFnMesh.getBlindDataAttrNames | ( | ) |
getBlindDataAttrNames(blindDataId) -> ((longName, shortName, typeName), ...) Returns a tuple listing the attributes of the given blind data type. Each element of the tuple is itself a tuple containing the long name, short name and type name of the attribute. Type names can be 'int', 'float', 'double', 'boolean', 'string' or 'binary'.
Signature: | getBlindDataAttrNames(blindDataId) | ||||||
Parameters: |
| ||||||
Returns: | ((longName, shortName, typeName), ...) | ||||||
Description: | Returns a tuple listing the attributes of the given blind data type. Each element of the tuple is itself a tuple containing the long name, short name and type name of the attribute. Type names can be "int", "float", "double", "boolean", "string" or "binary" |
OpenMaya.MFnMesh.getBlindDataTypes | ( | ) |
getBlindDataTypes(MFn Type constant) -> MIntArray Returns all the blind data ID's associated with the given component type on this mesh.
Signature: | getBlindDataTypes(compType) | ||||||
Parameters: |
| ||||||
Returns: | MIntArray | ||||||
Description: | Returns all the blind data ID's associated with the given component type on this mesh. |
OpenMaya.MFnMesh.getBoolBlindData | ( | ) |
getBoolBlindData(compId, compType, blindDataId, attr) -> bool getBoolBlindData(compType, blindDataId, attr) -> (MIntArray, MIntArray) The first version returns the value of the specified blind data attribute from the specified mesh component. The second version returns a tuple containing an array of component IDs and an array of values for the specified blind data attribute for all of the mesh's components of the specified type. Both versions raise RuntimeError if the attribute is not of 'boolean' type.
Signature: | getBoolBlindData(compId, compType, blindDataId, attr) | |||||||||||||||
Parameters: |
| |||||||||||||||
Returns: | bool | |||||||||||||||
Description: | Returns the value of the specified blind data attribute from the specified mesh component. Raises RuntimeError if the attribute is not of "bool" type. |
Signature: | getBoolBlindData(compType, blindDataId, attr) | ||||||||||||
Parameters: |
| ||||||||||||
Returns: | (MIntArray, MIntArray) | ||||||||||||
Description: | Returns a tuple containing an array of component IDs and an array of values for the specified blind data attribute for all of the mesh's components of the specified type. Raises RuntimeError if the attribute is not of "bool" type. |
OpenMaya.MFnMesh.getClosestNormal | ( | ) |
getClosestNormal(MPoint, space=MSpace.kObject) -> (MVector, int) Returns a tuple containing the normal at the closest point on the mesh to the given point and the ID of the face in which that closest point lies.
Signature: | getClosestNormal(point, space=MSpace.kObject) | |||||||||
Parameters: |
| |||||||||
Returns: | (MVector, int) | |||||||||
Description: | Returns a tuple containing the normal at the closest point on the mesh to the given point and the ID of the face in which that closest point lies. |
OpenMaya.MFnMesh.getClosestPoint | ( | ) |
getClosestPoint(MPoint, space=MSpace.kObject) -> (MPoint, int) Returns a tuple containing the closest point on the mesh to the given point and the ID of the face in which that closest point lies. This method is not threadsafe.
Signature: | getClosestPoint(point, space=MSpace.kObject) | |||||||||
Parameters: |
| |||||||||
Returns: | (MPoint, int) | |||||||||
Description: | Returns a tuple containing the closest point on the mesh to the given point and the ID of the face in which that closest point lies. This method is not threadsafe. |
OpenMaya.MFnMesh.getClosestPointAndNormal | ( | ) |
getClosestPointAndNormal(MPoint, space=MSpace.kObject) -> (MPoint, MVector, int) Returns a tuple containing the closest point on the mesh to the given point, the normal at that point, and the ID of the face in which that point lies. This method is not threadsafe.
Signature: | getClosestPointAndNormal(point, space=MSpace.kObject) | |||||||||
Parameters: |
| |||||||||
Returns: | (MPoint, MVector,int) | |||||||||
Description: | Returns a tuple containing the closest point on the mesh to the given point, the normal at that point, and the ID of the face in which that point lies. This method is not threadsafe. |
def OpenMaya.MFnMesh.getClosestUVs | ( | ) |
getClosestUVs(u, v, uvSet='') -> MIntArray Returns the IDs of the UVs which are nearest in uv space to the given texture coordinate in the specified UV set. All these UVs locate at the same distance to the given coordinate.
OpenMaya.MFnMesh.getColor | ( | ) |
getColor(colorId, colorSet='') -> MColor Returns a color from a colorSet. Raises IndexError if the colorId is out of range.
Signature: | getColor(colorId, colorSet='') | |||||||||
Parameters: |
| |||||||||
Returns: | MColor | |||||||||
Description: | Returns a color from a colorSet. Raises IndexError if the colorId is out of range. |
OpenMaya.MFnMesh.getColorIndex | ( | ) |
getColorIndex(faceId, localVertexId, colorSet='') -> int Returns the index into the specified colorSet of the color used by a specific face-vertex. This can be used to index into the sequence returned by getColors().
Signature: | getColorIndex(faceId, localVertexIndex, colorSet='') | ||||||||||||
Parameters: |
| ||||||||||||
Returns: | int | ||||||||||||
Description: | Returns the index into the specified colorSet of the color used by a specific face-vertex. This can be used to index into the sequence returned by getColors(). |
OpenMaya.MFnMesh.getColorRepresentation | ( | ) |
getColorRepresentation(colorSet) -> Color Representation constant Returns the Color Representation used by the specified color set.
Signature: | getColorRepresentation(colorSet) | ||||||
Parameters: |
| ||||||
Returns: | Color Representation constant | ||||||
Description: | Returns the Color Representation used by the specified color set. |
OpenMaya.MFnMesh.getColors | ( | ) |
getColors(colorSet='') -> MColorArray Returns all of the colors in a colorSet. If no colorSet is specified then the default colorSet is used. Use the index returned by getColorIndex() to access the returned array.
Signature: | getColors(colorSet='') | ||||||
Parameters: |
| ||||||
Returns: | MColorArray | ||||||
Description: | Returns all of the colors in a colorSet. If no colorSet is specified then the default colorSet is used. Use the index returned by getColorIndex() to access the returned array. |
OpenMaya.MFnMesh.getColorSetFamilyNames | ( | ) |
getColorSetFamilyNames() -> (string, ...) Returns the names of all of the color set families on this object. A color set family is a set of per-instance sets with the same name with each individual set applying to one or more instances. A set which is shared across all instances will be the sole member of its family. Given a color set family name, getColorSetsInFamily() may be used to determine the names of the associated individual sets.
Signature: | getColorSetFamilyNames() |
Parameters: | None. |
Returns: | tuple of strings |
Description: | Returns the names of all of the color set families on this object. A color set family is a set of per-instance sets with the same name with each individual set applying to one or more instances. A set which is shared across all instances will be the sole member of its family. Given a color set family name, getColorSetsInFamily() may be used to determine the names of the associated individual sets. |
OpenMaya.MFnMesh.getColorSetNames | ( | ) |
getColorSetNames() -> (string, ...) Returns the names of all the color sets on this object.
Signature: | getColorSetNames() |
Parameters: | None. |
Returns: | tuple of strings |
Description: | Returns the names of all the color sets on this object. |
OpenMaya.MFnMesh.getColorSetsInFamily | ( | ) |
getColorSetsInFamily(familyName) -> (string, ...) Returns the names of all of the color sets that belong to the specified family. Per-instance sets will have multiple sets in a family, with each individual set applying to one or more instances. A set which is shared across all instances will be the sole member of its family and will share the same name as its family.
Signature: | getColorSetsInFamily(familyName) | ||||||
Parameters: |
| ||||||
Returns: | tuple of strings | ||||||
Description: | Returns the names of all of the color sets that belong to the specified family. Per-instance sets will have multiple sets in a family, with each individual set applying to one or more instances. A set which is shared across all instances will be the sole member of its family and will share the same name as its family. |
OpenMaya.MFnMesh.getConnectedShaders | ( | ) |
getConnectedShaders(instance) -> (MObjectArray, MIntArray) Returns a tuple containing an array of shaders (sets) and an array of ints mapping the mesh's polygons onto those shaders. For each polygon in the mesh there will be corresponding value in the second array. If it is -1 that means that the polygon is not assigned to a shader, otherwise it indicates the index into the first array of the shader to which that polygon is assigned. This method will only work if the functionset is attached to a mesh node. It will raise RuntimeError if the functionset is attached to mesh data.
Signature: | getConnectedShaders(instance) | ||||||
Parameters: |
| ||||||
Returns: | (MObjectArray, MIntArray) | ||||||
Description: | Returns a tuple containing an array of shaders (sets) and an array of ints mapping the mesh's polygons onto those shaders. For each polygon in the mesh there will be corresponding value in the second array. If it is -1 that means that the polygon is not assigned to a shader, otherwise it indicates the index into the first array of the shader to which that polygon is assigned. This method will only work if the functionset is attached to a mesh node. It will raise RuntimeError if the functionset is attached to mesh data. |
OpenMaya.MFnMesh.getCreaseEdges | ( | ) |
getCreaseEdges() -> (MUintArray, MDoubleArray) Returns a tuple containing two arrays. The first contains the mesh- relative/global IDs of the mesh's creased edges and the second contains the associated crease data. Please note that to make effective use of the creasing variable in software outside of Maya may require a license under patents owned by Pixar(R).
Signature: | getCreaseEdges() |
Parameters: | None. |
Returns: | (MUintArray, MDoubleArray) |
Description: | Returns a tuple containing two arrays. The first contains the mesh-relative/global IDs of the mesh's creased edges and the second contains the associated crease data. Please note that to make effective use of the creasing variable in software outside of Maya may require a license under patents owned by Pixar(R). |
OpenMaya.MFnMesh.getCreaseVertices | ( | ) |
getCreaseVertices() -> (MUintArray, MDoubleArray) Returns a tuple containing two arrays. The first contains the mesh- relative/global IDs of the mesh's creased vertices and the second contains the associated crease data. Please note that to make effective use of the creasing variable in software outside of Maya may require a license under patents owned by Pixar(R).
Signature: | getCreaseVertices() |
Parameters: | None. |
Returns: | (MUintArray, MDoubleArray) |
Description: | Returns a tuple containing two arrays. The first contains the mesh-relative/global IDs of the mesh's creased vertices and the second contains the associated crease data. Please note that to make effective use of the creasing variable in software outside of Maya may require a license under patents owned by Pixar(R). |
OpenMaya.MFnMesh.getDoubleBlindData | ( | ) |
getDoubleBlindData(compId, compType, blindDataId, attr) -> float getDoubleBlindData(compType, blindDataId, attr) -> (MIntArray, MDoubleArray) The first version returns the value of the specified blind data attribute from the specified mesh component. The second version returns a tuple containing an array of component IDs and an array of values for the specified blind data attribute for all of the mesh's components of the specified type. Both versions raise RuntimeError if the attribute is not of 'double' type.
Signature: | getDoubleBlindData(compId, compType, blindDataId, attr) | |||||||||||||||
Parameters: |
| |||||||||||||||
Returns: | float | |||||||||||||||
Description: | Returns the value of the specified blind data attribute from the specified mesh component. Raises RuntimeError if the attribute is not of "double" type. |
Signature: | getDoubleBlindData(compType, blindDataId, attr) | ||||||||||||
Parameters: |
| ||||||||||||
Returns: | (MIntArray, MDoubleArray) | ||||||||||||
Description: | Returns a tuple containing an array of component IDs and an array of values for the specified blind data attribute for all of the mesh's components of the specified type. Raises RuntimeError if the attribute is not of "double" type. |
OpenMaya.MFnMesh.getEdgeVertices | ( | ) |
getEdgeVertices(edgeId) -> (int, int) Returns a tuple containing the mesh-relative/global IDs of the edge's two vertices. The indices can be used to refer to the elements in the array returned by the getPoints() method.
Signature: | getEdgeVertices(edgeId) | ||||||
Parameters: |
| ||||||
Returns: | (int, int) | ||||||
Description: | Returns a tuple containing the mesh-relative/global IDs of the edge's two vertices. The indices can be used to refer to the elements in the array returned by the getPoints() method. |
OpenMaya.MFnMesh.getFaceAndVertexIndices | ( | ) |
getFaceAndVertexIndices(faceVertexIndex, localVertex=True) -> (int, int) Returns a tuple containg the faceId and vertexIndex represented by the given face-vertex index. This is the reverse of the operation performed by getFaceVertexIndex(). If localVertex is True then the returned vertexIndex is the face- relative/local index, otherwise it is the mesh-relative/global index.
Signature: | getFaceAndVertexIndices(faceVertexIndex, localVertex=True) | |||||||||
Parameters: |
| |||||||||
Returns: | (faceId, vertexIndex) | |||||||||
Description: | Returns a tuple containg the faceId and vertexIndex represented by the given face-vertex index. This is the reverse of the operation performed by getFaceVertexIndex(). If localVertex is True then the returned vertexIndex is the face-relative/local index, otherwise it is the mesh-relative/global index. |
OpenMaya.MFnMesh.getFaceNormalIds | ( | ) |
getFaceNormalIds(faceId) -> MIntArray Returns the IDs of the normals for all the vertices of a given face. These IDs can be used to index into the arrays returned by getNormals().
Signature: | getFaceNormalIds(faceId) | ||||||
Parameters: |
| ||||||
Returns: | MIntArray | ||||||
Description: | Returns the IDs of the normals for all the vertices of a given face. These IDs can be used to index into the arrays returned by getNormals(). |
OpenMaya.MFnMesh.getFaceUVSetNames | ( | ) |
getFaceUVSetNames(faceId) -> (string, ...) Returns the names of all of the uv sets mapped to the specified face. This method is not threadsafe.
Signature: | getFaceUVSetNames(faceId) | ||||||
Parameters: |
| ||||||
Returns: | tuple of strings | ||||||
Description: | Returns the names of all of the uv sets mapped to the specified face. This method is not threadsafe. |
OpenMaya.MFnMesh.getFaceVertexBinormal | ( | ) |
getFaceVertexBinormal(faceId, vertexId, space=MSpace.kObject, uvSet='') -> MVector Returns the binormal vector at a given face vertex. This method is not threadsafe.
Signature: | getFaceVertexBinormal(faceId, vertexId, space=MSpace.kObject, uvSet='') | |||||||||||||||
Parameters: |
| |||||||||||||||
Returns: | MVector | |||||||||||||||
Description: | Returns the binormal vector at a given face vertex. This method is not threadsafe. |
OpenMaya.MFnMesh.getFaceVertexBinormals | ( | ) |
getFaceVertexBinormals(faceId, space=MSpace.kObject, uvSet='') -> MFloatVectorArray Returns all the per-vertex-per-face binormals for a given face. This method is not threadsafe.
Signature: | getFaceVertexBinormals(faceId, space=MSpace.kObject, uvSet='') | ||||||||||||
Parameters: |
| ||||||||||||
Returns: | MFloatVectorArray | ||||||||||||
Description: | Returns all the per-vertex-per-face binormals for a given face. This method is not threadsafe. |
OpenMaya.MFnMesh.getFaceVertexColors | ( | ) |
getFaceVertexColors(colorSet='', defaultUnsetColor=None) -> MColorArray Returns colors for all the mesh's face-vertices. The colors are returned in face order: e.g. F0V0, F0V1.. F0Vn, F1V0, etc... Use the index returned by getFaceVertexIndex() if you wish to index directly into the returned color array. If no face has color for that vertex, the entry returned will be defaultUnsetColor. If a color was set for some but not all the faces for that vertex, the ones where the color has not been explicitly set will return (0,0,0). If a vertex has shared color, the same value will be set for all its vertes/faces. If the colorSet is not specified, the default color set will be used. If the defaultUnsetColor is not given, then (-1, -1, -1, -1) will be used.
Signature: | getFaceVertexColors(colorSet='', defaultUnsetColor=None) | |||||||||
Parameters: |
| |||||||||
Returns: | MColorArray | |||||||||
Description: | Returns colors for all the mesh's face-vertices. The colors are returned in face order: e.g. F0V0, F0V1.. F0Vn, F1V0, etc... Use the index returned by getFaceVertexIndex() if you wish to index directly into the returned color array. If no face has color for that vertex, the entry returned will be defaultUnsetColor. If a color was set for some but not all the faces for that vertex, the ones where the color has not been explicitly set will return (0,0,0). If a vertex has shared color, the same value will be set for all its vertes/faces. If the colorSet is not specified, the default color set will be used. If the defaultUnsetColor is not given, then (-1, -1, -1, -1) will be used. |
OpenMaya.MFnMesh.getFaceVertexIndex | ( | ) |
getFaceVertexIndex(faceId, vertexIndex, localVertex=True) -> int Returns the index for a specific face-vertex into an array of face- vertex values, such as those returned by getFaceVertexBinormals(), getFaceVertexColors(), getFaceVertexNormals(), etc. The values in the target arrays are presumed to be in face order: F0V0, F0V1.. F0Vn, F1V0, etc... If localVertex is True then vertexIndex must be a face-relative/local index. If localVertex is False then vertexIndex must be a mesh- relative/global index. The opposite operation is performed by the getFaceAndVertexIndices() method.
Signature: | getFaceVertexIndex(faceId, vertexIndex, localVertex=True) | ||||||||||||
Parameters: |
| ||||||||||||
Returns: | int | ||||||||||||
Description: | Returns the index for a specific face-vertex into an array of face-vertex values, such as those returned by getFaceVertexBinormals(), getFaceVertexColors(), getFaceVertexNormals(), etc. The values in the target arrays are presumed to be in face order: e.g. F0V0, F0V1.. F0Vn, F1V0, etc... If localVertex is True then vertexIndex must be a face-relative/local index. If localVertex is False then vertexIndex must be a mesh-relative/global index. The opposite operation is performed by the getFaceAndVertexIndices() method. |
OpenMaya.MFnMesh.getFaceVertexNormal | ( | ) |
getFaceVertexNormal(faceId, vertexId, space=MSpace.kObject) -> MVector Returns the per-vertex-per-face normal for a given face and vertex. This method is not threadsafe.
Signature: | getFaceVertexNormal(faceId, vertexId, space=MSpace.kObject) | ||||||||||||
Parameters: |
| ||||||||||||
Returns: | MVector | ||||||||||||
Description: | Returns the per-vertex-per-face normal for a given face and vertex. This method is not threadsafe. |
OpenMaya.MFnMesh.getFaceVertexNormals | ( | ) |
getFaceVertexNormals(faceId, space=MSpace.kObject) -> MFloatVectorArray Returns the normals for a given face. This method is not threadsafe.
Signature: | getFaceVertexNormals(faceId, space=MSpace.kObject) | |||||||||
Parameters: |
| |||||||||
Returns: | MFloatVectorArray | |||||||||
Description: | Returns the normals for a given face. This method is not threadsafe. |
OpenMaya.MFnMesh.getFaceVertexTangent | ( | ) |
getFaceVertexTangent(faceId, vertexId, space=MSpace.kObject, uvSet='') -> MVector Return the normalized tangent vector at a given face vertex. The tangent is defined as the surface tangent of the polygon running in the U direction defined by the uv map. This method is not threadsafe.
Signature: | getFaceVertexTangent(faceId, vertexId, space=MSpace.kObject, uvSet='') | |||||||||||||||
Parameters: |
| |||||||||||||||
Returns: | MVector | |||||||||||||||
Description: | Return the normalized tangent vector at a given face vertex. The tangent is defined as the surface tangent of the polygon running in the U direction defined by the uv map. This method is not threadsafe. |
OpenMaya.MFnMesh.getFaceVertexTangents | ( | ) |
getFaceVertexTangents(faceId, space=MSpace.kObject, uvSet='') -> MFloatVectorArray Returns all the per-vertex-per-face tangents for a given face. The tangent is defined as the surface tangent of the polygon running in the U direction defined by the uv map. This method is not threadsafe.
Signature: | getFaceVertexTangents(faceId, space=MSpace.kObject, uvSet='') | ||||||||||||
Parameters: |
| ||||||||||||
Returns: | MFloatVectorArray | ||||||||||||
Description: | Returns all the per-vertex-per-face tangents for a given face. The tangent is defined as the surface tangent of the polygon running in the U direction defined by the uv map. This method is not threadsafe. |
OpenMaya.MFnMesh.getFloatBlindData | ( | ) |
getFloatBlindData(compId, compType, blindDataId, attr) -> float getFloatBlindData(compType, blindDataId, attr) -> (MIntArray, MFloatArray) The first version returns the value of the specified blind data attribute from the specified mesh component. The second version returns a tuple containing an array of component IDs and an array of values for the specified blind data attribute for all of the mesh's components of the specified type. Both versions raise RuntimeError if the attribute is not of 'float' type.
Signature: | getFloatBlindData(compId, compType, blindDataId, attr) | |||||||||||||||
Parameters: |
| |||||||||||||||
Returns: | float | |||||||||||||||
Description: | Returns the value of the specified blind data attribute from the specified mesh component. Raises RuntimeError if the attribute is not of "float" type. |
Signature: | getFloatBlindData(compType, blindDataId, attr) | ||||||||||||
Parameters: |
| ||||||||||||
Returns: | (MIntArray, MFloatArray) | ||||||||||||
Description: | Returns a tuple containing an array of component IDs and an array of values for the specified blind data attribute for all of the mesh's components of the specified type. Raises RuntimeError if the attribute is not of "float" type. |
OpenMaya.MFnMesh.getFloatPoints | ( | ) |
getFloatPoints(space=MSpace.kObject) -> MFloatPointArray Returns an MFloatPointArray containing the mesh's vertices.
Signature: | getFloatPoints(space=MSpace.kObject) | ||||||
Parameters: |
| ||||||
Returns: | MFloatPointArray | ||||||
Description: | Returns a copy of the mesh's vertex positions as an MFloatPointArray. |
OpenMaya.MFnMesh.getHoles | ( | ) |
getHoles() -> ((face, (v1, v2, ...)), (face, (v1, v2, ...)), ...) Returns a tuple describing the holes in the mesh. Each element of the tuple is itself a tuple. The first element of the sub-tuple is the integer ID of the face in which the hole occurs. The second element of the sub-tuple is another tuple containing the mesh-relative/global IDs of the vertices which make up the hole. Take the following return value as an example: ((3, (7, 2, 6)), (5, (11, 10, 3, 4))) This says that the mesh has two holes. The first hole is in face 3 and consists of vertices 7, 2 and 6. The second hole is in face 5 and consists of vertices 11, 10, 3 and 4.
Signature: | getHoles() |
Parameters: | None. |
Returns: | ((face, (v1, v2, ...)), (face, (v1, v2, ...)), ...) |
Description: | Returns a tuple describing the holes in the mesh. Each element of the tuple is itself a tuple. The first element of the sub-tuple is the integer ID of the face in which the hole occurs. The second element of the sub-tuple is another tuple containing the mesh-relative/global IDs of the vertices which make up the hole. Take the following return value as an example: ((3, (7, 2, 6)), (5, (11, 10, 3, 4))) This says that the mesh has two holes. The first hole is in face 3 and consists of vertices 7, 2 and 6. The second hole is in face 5 and consists of vertices 11, 10, 3 and 4. |
OpenMaya.MFnMesh.getIntBlindData | ( | ) |
getIntBlindData(compId, compType, blindDataId, attr) -> int getIntBlindData(compType, blindDataId, attr) -> (MIntArray, MIntArray) The first version returns the value of the specified blind data attribute from the specified mesh component. The second version returns a tuple containing an array of component IDs and an array of values for the specified blind data attribute for all of the mesh's components of the specified type. Both versions raise RuntimeError if the attribute is not of 'int' type.
Signature: | getIntBlindData(compId, compType, blindDataId, attr) | |||||||||||||||
Parameters: |
| |||||||||||||||
Returns: | int | |||||||||||||||
Description: | Returns the value of the specified blind data attribute from the specified mesh component. Raises RuntimeError if the attribute is not of "int" type. |
Signature: | getIntBlindData(compType, blindDataId, attr) | ||||||||||||
Parameters: |
| ||||||||||||
Returns: | (MIntArray, MIntArray) | ||||||||||||
Description: | Returns a tuple containing an array of component IDs and an array of values for the specified blind data attribute for all of the mesh's components of the specified type. Raises RuntimeError if the attribute is not of "int" type. |
OpenMaya.MFnMesh.getInvisibleFaces | ( | ) |
getInvisibleFaces() -> MUintArray Returns the invisible faces of the mesh. Invisible faces are like lightweight holes in that they are not rendered but do not require additional geometry the way that holes do. They have the advantage over holes that if the mesh is smoothed then their edges will be smoothed as well, while holes will retain their hard edges. Invisible faces can be set using the setInvisibleFaces() method or the polyHole command.
Signature: | getInvisibleFaces() |
Parameters: | None. |
Returns: | MUintArray |
Description: | Returns the invisible faces of the mesh. Invisible faces are like lightweight holes in that they are not rendered but do not require additional geometry the way that holes do. They have the advantage over holes that if the mesh is smoothed then their edges will be smoothed as well, while holes will retain their hard edges. Invisible faces can be set using the setInvisibleFaces() method or the polyHole command. |
OpenMaya.MFnMesh.getNormalIds | ( | ) |
getNormalIds() -> (MIntArray, MIntArray) Returns the normal IDs for all of the mesh's polygons as a tuple of two int arrays. The first array contains the number of vertices for each polygon and the second contains the normal IDs for each polygon- vertex. These IDs can be used to index into the array returned by getNormals().
Signature: | getNormalIds() |
Parameters: | None. |
Returns: | (MIntArray, MIntArray) |
Description: | Returns the normal IDs for all of the mesh's polygons as a tuple of two int arrays. The first array contains the number of vertices for each polygon and the second contains the normal IDs for each polygon-vertex. These IDs can be used to index into the array returned by getNormals(). |
OpenMaya.MFnMesh.getNormals | ( | ) |
getNormals(space=MSpace.kObject) -> MFloatVectorArray Returns a copy of the mesh's normals. The normals are the per-polygon per-vertex normals. To find the normal for a particular vertex-face, use getFaceNormalIds() to get the index into the array. This method is not threadsafe.
Signature: | getNormals(space=MSpace.kObject) | ||||||
Parameters: |
| ||||||
Returns: | MFloatVectorArray | ||||||
Description: | Returns a copy of the mesh's normals. The normals are the per-polygon per-vertex normals. To find the normal for a particular vertex-face, use getFaceNormalIds() to get the index into the array. This method is not threadsafe. |
OpenMaya.MFnMesh.getPoint | ( | ) |
getPoint(vertexId, space=MSpace.kObject) -> MPoint Returns the position of specified vertex.
Signature: | getPoint(vertexId, space=MSpace.kObject) | |||||||||
Parameters: |
| |||||||||
Returns: | MPoint | |||||||||
Description: | Returns the position of specified vertex. |
OpenMaya.MFnMesh.getPointAtUV | ( | ) |
getPointAtUV(faceId, u, v, space=MSpace.kObject, uvSet='', tolerance=0.0) -> MPoint Returns the position of the point at the give UV value in the specified face. This method is not threadsafe.
Signature: | getPointAtUV(faceId, u, v, space=MSpace.kObject, uvSet='', tolerance=0.0) | |||||||||||||||||||||
Parameters: |
| |||||||||||||||||||||
Returns: | MPoint | |||||||||||||||||||||
Description: | Returns the position of the point at the give UV value in the specified face. This method is not threadsafe. |
OpenMaya.MFnMesh.getPoints | ( | ) |
getPoints(space=MSpace.kObject) -> MPointArray Returns a copy of the mesh's vertex positions as an MPointArray.
Signature: | getPoints(space=MSpace.kObject) | ||||||
Parameters: |
| ||||||
Returns: | MPointArray | ||||||
Description: | Returns a copy of the mesh's vertex positions as an MPointArray. |
def OpenMaya.MFnMesh.getPointsAtUV | ( | ) |
getPointsAtUV(u, v, space=MSpace.kObject, uvSet='', tolerance=0.0) -> MPoint Returns the position of the point at the give UV value
OpenMaya.MFnMesh.getPolygonNormal | ( | ) |
getPolygonNormal(polygonId, space=MSpace.kObject) -> MVector Returns the per-polygon normal for the given polygon. This method is not threadsafe.
Signature: | getPolygonNormal(polygonId, space=MSpace.kObject) | |||||||||
Parameters: |
| |||||||||
Returns: | MVector | |||||||||
Description: | Returns the per-polygon normal for the given polygon. This method is not threadsafe. |
OpenMaya.MFnMesh.getPolygonTriangleVertices | ( | ) |
getPolygonTriangleVertices(polygonId, triangleId) -> (int, int, int) Returns the mesh-relative/global IDs of the 3 vertices of the specified triangle of the specified polygon. These IDs can be used to index into the arrays returned by getPoints() and getFloatPoints().
Signature: | getPolygonTriangleVertices(polygonId, triangleId) | |||||||||
Parameters: |
| |||||||||
Returns: | (int, int, int) | |||||||||
Description: | Returns the mesh-relative/global IDs of the 3 vertices of the specified triangle of the specified polygon. These IDs can be used to index into the arrays returned by getPoints() and getFloatPoints(). |
OpenMaya.MFnMesh.getPolygonUV | ( | ) |
getPolygonUV(polygonId, vertexId, uvSet='') -> (float, float) Returns a tuple containing the U and V values at a specified vertex of a specified polygon. This method is not threadsafe.
Signature: | getPolygonUV(polygonId, vertexId, uvSet='') | ||||||||||||
Parameters: |
| ||||||||||||
Returns: | (float, float) | ||||||||||||
Description: | Returns a tuple containing the U and V values at a specified vertex of a specified polygon. This method is not threadsafe. |
OpenMaya.MFnMesh.getPolygonUVid | ( | ) |
getPolygonUVid(polygonId, vertexId, uvSet='') -> int Returns the ID of the UV at a specified vertex of a specified polygon. This method is not threadsafe.
Signature: | getPolygonUVid(polygonId, vertexId, uvSet='') | ||||||||||||
Parameters: |
| ||||||||||||
Returns: | int | ||||||||||||
Description: | Returns the ID of the UV at a specified vertex of a specified polygon. This method is not threadsafe. |
OpenMaya.MFnMesh.getPolygonVertices | ( | ) |
getPolygonVertices(polygonId) -> MIntArray Returns the mesh-relative/global vertex IDs the specified polygon. These IDs can be used to index into the arrays returned by getPoints() and getFloatPoints().
Signature: | getPolygonVertices(polygonId) | ||||||
Parameters: |
| ||||||
Returns: | MIntArray | ||||||
Description: | Returns the mesh-relative/global vertex IDs the specified polygon. These IDs can be used to index into the arrays returned by getPoints() and getFloatPoints(). |
OpenMaya.MFnMesh.getSmoothMeshDisplayOptions | ( | ) |
getSmoothMeshDisplayOptions() -> MMeshSmoothOptions Returns the options currently in use when smoothing the mesh for display.
Signature: | getSmoothMeshDisplayOptions() |
Parameters: | None. |
Returns: | MMeshSmoothOptions |
Description: | Returns the options currently in use when smoothing the mesh for display. |
OpenMaya.MFnMesh.getStringBlindData | ( | ) |
getStringBlindData(compId, compType, blindDataId, attr) -> string getStringBlindData(compType, blindDataId, attr) -> (MIntArray, [string, string, ...]) The first version returns the value of the specified blind data attribute from the specified mesh component. The second version returns a tuple containing an array of component IDs and an array of values for the specified blind data attribute for all of the mesh's components of the specified type. Both versions raise RuntimeError if the attribute is not of 'string' type.
Signature: | getStringBlindData(compId, compType, blindDataId, attr) | |||||||||||||||
Parameters: |
| |||||||||||||||
Returns: | string | |||||||||||||||
Description: | Returns the value of the specified blind data attribute from the specified mesh component. Raises RuntimeError if the attribute is not of "string" type. |
Signature: | getStringBlindData(compType, blindDataId, attr) | ||||||||||||
Parameters: |
| ||||||||||||
Returns: | (MIntArray, [string, string, ...]) | ||||||||||||
Description: | Returns a tuple containing an array of component IDs and an array of values for the specified blind data attribute for all of the mesh's components of the specified type. Raises RuntimeError if the attribute is not of "string" type. |
OpenMaya.MFnMesh.getTangentId | ( | ) |
getTangentId(faceId, vertexId) -> int Returns the ID of the tangent for a given face and vertex.
Signature: | getTangentId(faceId, vertexId) | |||||||||
Parameters: |
| |||||||||
Returns: | int | |||||||||
Description: | Returns the ID of the tangent for a given face and vertex. |
OpenMaya.MFnMesh.getTangents | ( | ) |
getTangents(space=MSpace.kObject, uvSet='') -> MFloatVectorArray Return the tangent vectors for all face vertices. The tangent is defined as the surface tangent of the polygon running in the U direction defined by the uv map. This method is not threadsafe.
Signature: | getTangents(space=MSpace.kObject, uvSet='') | |||||||||
Parameters: |
| |||||||||
Returns: | MFloatVectorArray | |||||||||
Description: | Return the tangent vectors for all face vertices. The tangent is defined as the surface tangent of the polygon running in the U direction defined by the uv map. This method is not threadsafe. |
def OpenMaya.MFnMesh.getTriangleOffsets | ( | ) |
getTriangleOffsets() -> (MIntArray, MIntArray) Returns the number of triangles for every polygon face and the offset into the vertex indices array for each triangle vertex (see getVertices()). The triangleVertices array holds each vertex for each triangle in sequence, so it has three times as many elements as there are triangles. (i.e. three times the sum of the elements of the triangleCounts array)
OpenMaya.MFnMesh.getTriangles | ( | ) |
getTriangles() -> (MIntArray, MIntArray) Returns a tuple describing the mesh's triangulation. The first element of the tuple is an array giving the number of triangles for each of the mesh's polygons. The second tuple gives the ids of the vertices of all the triangles.
Signature: | getTriangles() |
Parameters: | None. |
Returns: | (MIntArray, MIntArray) |
Description: | Returns a tuple describing the mesh's triangulation. The first element of the tuple is an array giving the number of triangles for each of the mesh's polygons. The second tuple gives the ids of the vertices of all the triangles. |
OpenMaya.MFnMesh.getUV | ( | ) |
getUV(uvId, uvSet='') -> (float, float) Returns a tuple containing the u and v values of the specified UV.
Signature: | getUV(uvId, uvSet='') | |||||||||
Parameters: |
| |||||||||
Returns: | (float, float) | |||||||||
Description: | Returns a tuple containing the u and v values of the specified UV. |
OpenMaya.MFnMesh.getUVAtPoint | ( | ) |
getUVAtPoint(point, space=MSpace.kObject, uvSet='') -> (float, float, int) Returns a tuple containing the u and v coordinates of the point on the mesh closest to the given point, and the ID of the face containing that closest point. This method is not threadsafe.
Signature: | getUVAtPoint(point, space=MSpace.kObject, uvSet='') | ||||||||||||
Parameters: |
| ||||||||||||
Returns: | (float, float, int) | ||||||||||||
Description: | Returns a tuple containing the u and v coordinates of the point on the mesh closest to the given point, and the ID of the face containing that closest point. This method is not threadsafe. |
OpenMaya.MFnMesh.getUVs | ( | ) |
getUVs(uvSet='') -> (MFloatArray, MFloatArray) Returns a tuple containing an array of U values and an array of V values, representing all of the UVs for the given UV set.
Signature: | getUVs(uvSet='') | ||||||
Parameters: |
| ||||||
Returns: | (MFloatArray, MFloatArray) | ||||||
Description: | Returns a tuple containing an array of U values and an array of V values, representing all of the UVs for the given UV set. |
OpenMaya.MFnMesh.getUVSetFamilyNames | ( | ) |
getUVSetFamilyNames() -> (string, ...) Returns the names of all of the uv set families on this object. A uv set family is a set of per-instance sets with the same name with each individual set applying to one or more instances. A set which is shared across all instances will be the sole member of its family. Given a uv set family name, getUVSetsInFamily() may be used to determine the names of the associated individual sets.
Signature: | getUVSetFamilyNames() |
Parameters: | None. |
Returns: | tuple of strings |
Description: | Returns the names of all of the uv set families on this object. A uv set family is a set of per-instance sets with the same name with each individual set applying to one or more instances. A set which is shared across all instances will be the sole member of its family. Given a uv set family name, getUVSetsInFamily() may be used to determine the names of the associated individual sets. |
OpenMaya.MFnMesh.getUVSetNames | ( | ) |
getUVSetNames() -> (string, ...) Returns the names of all the uv sets on this object.
Signature: | getUVSetNames() |
Parameters: | None. |
Returns: | tuple of strings |
Description: | Returns the names of all the uv sets on this object. |
OpenMaya.MFnMesh.getUVSetsInFamily | ( | ) |
getUVSetsInFamily(familyName) -> (string, ...) Returns the names of all of the uv sets that belong to the specified family. Per-instance sets will have multiple sets in a family, with each individual set applying to one or more instances. A set which is shared across all instances will be the sole member of its family and will share the same name as its family.
Signature: | getUVSetsInFamily(familyName) | ||||||
Parameters: |
| ||||||
Returns: | tuple of strings | ||||||
Description: | Returns the names of all of the uv sets that belong to the specified family. Per-instance sets will have multiple sets in a family, with each individual set applying to one or more instances. A set which is shared across all instances will be the sole member of its family and will share the same name as its family. |
OpenMaya.MFnMesh.getUvShellsIds | ( | ) |
getUvShellsIds(uvSet='') -> (int, MIntArray) Returns a tuple containing describing how the specified UV set's UVs are grouped into shells. The first element of the tuple is the number of distinct shells. The second element of the tuple is an array of shell indices, one per uv, indicating which shell that uv is part of.
Signature: | getUvShellsIds(uvSet='') | ||||||
Parameters: |
| ||||||
Returns: | (int, MIntArray) | ||||||
Description: | Returns a tuple containing describing how the specified UV set's UVs are grouped into shells. The first element of the tuple is the number of distinct shells. The second element of the tuple is an array of shell indices, one per uv, indicating which shell that uv is part of. |
OpenMaya.MFnMesh.getVertexColors | ( | ) |
getVertexColors(colorSet='', defaultUnsetColor=None) -> MColorArray Gets colors for all vertices of the given colorSet. If no face has color for that vertex, the entry returned will be defaultUnsetColor. If a color was set for some or all the faces for that vertex, an average of those vertex/face values where the color has been set will be returned. If the colorSet is not specified, the default color set will be used. If the defaultUnsetColor is not given, then (-1, -1, -1, -1) will be used.
Signature: | getVertexColors(colorSet='', defaultUnsetColor=None) | |||||||||
Parameters: |
| |||||||||
Returns: | MColorArray | |||||||||
Description: | Gets colors for all vertices of the given colorSet. If no face has color for that vertex, the entry returned will be defaultUnsetColor. If a color was set for some or all the faces for that vertex, an average of those vertex/face values where the color has been set will be returned. If the colorSet is not specified, the default color set will be used. If the defaultUnsetColor is not given, then (-1, -1, -1, -1) will be used. |
OpenMaya.MFnMesh.getVertexNormal | ( | ) |
getVertexNormal(vertexId, angleWeighted, space=MSpace.kObject) -> MVector Returns the normal at the given vertex. The returned normal is a single per-vertex normal, so unshared normals at a vertex will be averaged. If angleWeighted is set to true, the normals are computed by an average of surrounding face normals weighted by the angle subtended by the face at the vertex. If angleWeighted is set to false, a simple average of surround face normals is returned. The simple average evaluation is significantly faster than the angle- weighted average. This method is not threadsafe.
Signature: | getVertexNormal(vertexId, angleWeighted, space=MSpace.kObject) | ||||||||||||
Parameters: |
| ||||||||||||
Returns: | MVector | ||||||||||||
Description: | Returns the normal at the given vertex. The returned normal is a single per-vertex normal, so unshared normals at a vertex will be averaged. If angleWeighted is set to true, the normals are computed by an average of surrounding face normals weighted by the angle subtended by the face at the vertex. If angleWeighted is set to false, a simple average of surround face normals is returned. The simple average evaluation is significantly faster than the angle-weighted average. This method is not threadsafe. |
OpenMaya.MFnMesh.getVertexNormals | ( | ) |
getVertexNormals(angleWeighted, space=MSpace.kObject) -> MFloatVectorArray Returns all the vertex normals. The returned normals are per-vertex normals, so unshared normals at a vertex will be averaged. If angleWeighted is set to True, the normals are computed by an average of surrounding face normals weighted by the angle subtended by the face at the vertex. If angleWeighted is set to false, a simple average of surround face normals is returned. The simple average evaluation is significantly faster than the angle- weighted average. This method is not threadsafe.
Signature: | getVertexNormals(angleWeighted, space=MSpace.kObject) | |||||||||
Parameters: |
| |||||||||
Returns: | MFloatVectorArray | |||||||||
Description: | Returns all the vertex normals. The returned normals are per-vertex normals, so unshared normals at a vertex will be averaged. If angleWeighted is set to True, the normals are computed by an average of surrounding face normals weighted by the angle subtended by the face at the vertex. If angleWeighted is set to false, a simple average of surround face normals is returned. The simple average evaluation is significantly faster than the angle-weighted average. This method is not threadsafe. |
OpenMaya.MFnMesh.getVertices | ( | ) |
getVertices() -> (MIntArray, MIntArray) Returns the mesh-relative/global vertex IDs for all of the mesh's polygons as a tuple of two int arrays. The first array contains the number of vertices for each polygon and the second contains the mesh- relative IDs for each polygon-vertex. These IDs can be used to index into the arrays returned by getPoints() and getFloatPoints().
Signature: | getVertices() |
Parameters: | None. |
Returns: | (MIntArray, MIntArray) |
Description: | Returns the mesh-relative/global vertex IDs for all of the mesh's polygons as a tuple of two int arrays. The first array contains the number of vertices for each polygon and the second contains the mesh-relative IDs for each polygon-vertex. These IDs can be used to index into the arrays returned by getPoints() and getFloatPoints(). |
|
static |
globalIntersectionAcceleratorsInfo() -> string Returns a string that describes the system-wide resource usage for cached mesh intersection accelerators. The string will be of the following form: total 10 accelerators created (2 currently active - total current memory = 10000KB), total build time = 10.2s, peak memory = 14567.1KB This means that: * a total of 10 intersection accelerators have been created as instructed by calls to closestIntersection(), allIntersections(), or anyIntersection() with non-NULL accelParams values. Thesen structures are destroyed and re-created when intersection requests with differing acceleration parameters are passed in for the same mesh, so it is useful to see this value, which is the total count of how many have been created. In this case, 8 of the 10 created have been destroyed, either automatically or via calls to the freeCachedIntersectionAccelerator() method * the total memory footprint for the 2 accelerators currently in existence is 10,000KB * the total build time for all 10 structures that have been created is 10.2 seconds * the peak of total memory usage for all accelerators in the system was 14567.1KB Calling clearGlobalIntersectionAcceleratorInfo() will clear the 'total count', 'total build time', and 'peak memory' fields from this information. It will not cause information about currently existing accelerators to be lost.
Signature: | globalIntersectionAcceleratorsInfo() |
Parameters: | None. |
Returns: | string |
Description: | Returns a string that describes the systemwide resource usage for cached mesh intersection accelerators. The string will be of the following form: total 10 accelerators created (2 currently active - total current memory = 10000KB), total build time = 10.2s, peak memory = 14567.1KB This means that:
Calling clearGlobalIntersectionAcceleratorInfo() will clear the "total count", "total build time", and "peak memory" fields from this information. It will not cause information about currently existing accelerators to be lost. |
OpenMaya.MFnMesh.hasAlphaChannels | ( | ) |
hasAlphaChannels(colorSet) -> bool Returns True if the color set has an alpha channel.
Signature: | hasAlphaChannels(colorSet) | ||||||
Parameters: |
| ||||||
Returns: | bool | ||||||
Description: | Returns True if the color set has an alpha channel. |
OpenMaya.MFnMesh.hasBlindData | ( | ) |
hasBlindData(compType, compId=None, blindDataId=None) -> bool Returns true if any component of the given type on this mesh has blind data. If a component ID is provided then only that particular component is checked. If a blind data ID is provided then only blind data of that type is checked.
Signature: | hasBlindData(compType, compId=None, blindDataId=None) | ||||||||||||
Parameters: |
| ||||||||||||
Returns: | bool | ||||||||||||
Description: | Returns true if any component of the given type on this mesh has blind data. If a component ID is provided then only that particular component is checked. If a blind data ID is provided then only blind data of that type is checked. |
OpenMaya.MFnMesh.hasColorChannels | ( | ) |
hasColorChannels(colorSet) -> bool Returns True if the color set has RGB channels.
Signature: | hasColorChannels(colorSet) | ||||||
Parameters: |
| ||||||
Returns: | bool | ||||||
Description: | Returns True if the color set has RGB channels. |
def OpenMaya.MFnMesh.intersectFaceAtUV | ( | ) |
intersectFaceAtUV(u, v, uvSet='') -> int Returns the IDs of the UVs on this surface which are nearest in uv space to the given uv set and coordinate.All these UVs locate at the same distance to the given coordinate. This method is not threadsafe.
OpenMaya.MFnMesh.isBlindDataTypeUsed | ( | ) |
isBlindDataTypeUsed(blindDataId) -> bool Returns True if the blind data type is already in use anywhere in the scene.
Signature: | isBlindDataTypeUsed(blindDataId) | ||||||
Parameters: |
| ||||||
Returns: | bool | ||||||
Description: | Returns True if the blind data type is already in use anywhere in the scene. |
OpenMaya.MFnMesh.isColorClamped | ( | ) |
isColorClamped(colorSet) -> bool Returns True if the color sets RGBA components are clamped to the range 0 to 1.
Signature: | isColorClamped(colorSet) | ||||||
Parameters: |
| ||||||
Returns: | bool | ||||||
Description: | Returns True if the color sets RGBA components are clamped to the range 0 to 1. |
OpenMaya.MFnMesh.isColorSetPerInstance | ( | ) |
isColorSetPerInstance(colorSet) -> bool Returns True if the color set is per-instance, and False if it is shared across all instances.
Signature: | isColorSetPerInstance(colorSet) | ||||||
Parameters: |
| ||||||
Returns: | bool | ||||||
Description: | Returns True if the color set is per-instance, and False if it is shared across all instances. |
OpenMaya.MFnMesh.isEdgeSmooth | ( | ) |
isEdgeSmooth(edgeId) -> bool Returns True if the edge is smooth, False if it is hard.
Signature: | isEdgeSmooth(edgeId) | ||||||
Parameters: |
| ||||||
Returns: | bool | ||||||
Description: | Returns True if the edge is smooth, False if it is hard. |
OpenMaya.MFnMesh.isNormalLocked | ( | ) |
isNormalLocked(normalId) -> bool Returns True if the normal is locked, False otherwise.
Signature: | isNormalLocked(normalId) | ||||||
Parameters: |
| ||||||
Returns: | bool | ||||||
Description: | Returns True if the normal is locked, False otherwise. |
OpenMaya.MFnMesh.isPolygonConvex | ( | ) |
isPolygonConvex(faceId) -> bool Returns True if the polygon is convex, False if it is concave.
Signature: | isPolygonConvex(faceId) | ||||||
Parameters: |
| ||||||
Returns: | bool | ||||||
Description: | Returns True if the polygon is convex, False if it is concave. |
def OpenMaya.MFnMesh.isPolygonUVReversed | ( | ) |
isPolygonUVReversed(faceId) -> bool Returns True if the texture coordinates (uv's) for specified polygon are reversed (clockwise), False if they are not reversed (counter clockwise).
def OpenMaya.MFnMesh.isRightHandedTangent | ( | ) |
isRightHandedTangent(tangentId, uvSet='') -> bool Returns True if the normal, tangent, and binormal form a right handed coordinate system, False otherwise.
OpenMaya.MFnMesh.isUVSetPerInstance | ( | ) |
isUVSetPerInstance(uvSet) -> bool Returns True if the UV set is per-instance, and False if it is shared across all instances.
Signature: | isUVSetPerInstance(uvSet) | ||||||
Parameters: |
| ||||||
Returns: | bool | ||||||
Description: | Returns True if the UV set is per-instance, and False if it is shared across all instances. |
OpenMaya.MFnMesh.lockFaceVertexNormals | ( | ) |
lockFaceVertexNormals(seq of faceIds, seq of vertIds) -> self Locks the normals for the given face/vertex pairs.
Signature: | lockFaceVertexNormals(faceIds, vertexIds) | |||||||||
Parameters: |
| |||||||||
Returns: | Reference to self | |||||||||
Description: | Locks the normals for the given face/vertex pairs. |
OpenMaya.MFnMesh.lockVertexNormals | ( | ) |
lockVertexNormals(sequence of vertIds) -> self Locks the shared normals for the specified vertices.
Signature: | lockVertexNormals(vertexIds) | ||||||
Parameters: |
| ||||||
Returns: | Reference to self | ||||||
Description: | Locks the shared normals for the specified vertices. |
OpenMaya.MFnMesh.numColors | ( | ) |
numColors(colorSet='') -> int Returns the number of colors in the given color set. If no color set is specified then the mesh's current color set will be used.
Signature: | numColors(colorSet='') | ||||||
Parameters: |
| ||||||
Returns: | int | ||||||
Description: | Returns the number of colors in the given color set. If no color set is specified then the mesh's current color set will be used. |
OpenMaya.MFnMesh.numUVs | ( | ) |
numUVs(uvSet='') -> int Returns the number of UVs (texture coordinates) in the given UV set. If no UV set is specified then the mesh's current UV set will be used.
Signature: | numUVs(uvSet='') | ||||||
Parameters: |
| ||||||
Returns: | int | ||||||
Description: | Returns the number of UVs (texture coordinates) in the given UV set. If no UV set is specified then the mesh's current UV set will be used. |
OpenMaya.MFnMesh.onBoundary | ( | ) |
onBoundary(faceId) -> bool Returns true if the face is on the border of the mesh, meaning that one or more of its edges is a border edge.
Signature: | onBoundary(faceId) | ||||||
Parameters: |
| ||||||
Returns: | bool | ||||||
Description: | Returns true if the face is on the border of the mesh, meaning that one or more of its edges is a border edge. |
OpenMaya.MFnMesh.polygonVertexCount | ( | ) |
polygonVertexCount(faceId) -> int Returns the number of vertices in the given polygon. Raises ValueError if the polygon ID is invalid.
Signature: | polygonVertexCount(faceId) | ||||||
Parameters: |
| ||||||
Returns: | int | ||||||
Description: | Returns the number of vertices in the given polygon. Raises ValueError if the polygon ID is invalid. |
OpenMaya.MFnMesh.removeFaceColors | ( | ) |
removeFaceColors(seq of faceIds) -> self Removes colors from all vertices of the specified faces.
Signature: | removeFaceColors(faceIds) | ||||||
Parameters: |
| ||||||
Returns: | Reference to self | ||||||
Description: | Removes colors from all vertices of the specified faces. |
OpenMaya.MFnMesh.removeFaceVertexColors | ( | ) |
removeFaceVertexColors(seq of faceIds, seq of vertexIds) -> self Removes colors from the specified face/vertex pairs.
Signature: | removeFaceVertexColors(faceIds, vertexIds) | |||||||||
Parameters: |
| |||||||||
Returns: | Reference to self | |||||||||
Description: | Removes colors from the specified face/vertex pairs. |
OpenMaya.MFnMesh.removeVertexColors | ( | ) |
removeVertexColors(seq of vertexIds) -> self Removes colors from the specified vertices in all of the faces which share those vertices.
Signature: | removeVertexColors(vertexIds) | ||||||
Parameters: |
| ||||||
Returns: | Reference to self | ||||||
Description: | Removes colors from the specified vertices in all of the faces which share those vertices. |
OpenMaya.MFnMesh.renameUVSet | ( | ) |
renameUVSet(origName, newName, modifier=None) -> self Renames a UV set. The set must exist and the new name cannot be the same as that of an existing set. This method is only valid for functionsets which are attached to mesh nodes, not mesh data.
Signature: | renameUVSet(origName, newName, modifier=None) | ||||||||||||
Parameters: |
| ||||||||||||
Returns: | Reference to self | ||||||||||||
Description: | Renames a UV set. The set must exist and the new name cannot be the same as that of an existing set. This method is only valid for functionsets which are attached to mesh nodes, not mesh data. |
OpenMaya.MFnMesh.setBinaryBlindData | ( | ) |
setBinaryBlindData(compId, compType, blindDataId, attr, data) -> self setBinaryBlindData(seq of compId, compType, blindDataId, attr, data) -> self The first version sets the value of a 'binary' blind data attribute on a single component of the mesh. The data must be a single string. The second version sets the value of a 'binary' blind data attribute on multiple components of the mesh. If the data is a sequence of strings then it must provide a value for each component in compIds. If it is a single string then all of the specified components will have their blind data set to that value.
Signature: | setBinaryBlindData(compId, compType, blindDataId, attr, data) | ||||||||||||||||||
Parameters: |
| ||||||||||||||||||
Returns: | Reference to self | ||||||||||||||||||
Description: | Sets the value of a "binary" blind data attribute on a component of the mesh. |
Signature: | setBinaryBlindData(compIds, compType, blindDataId, attr, data) | ||||||||||||||||||
Parameters: |
| ||||||||||||||||||
Returns: | Reference to self | ||||||||||||||||||
Description: | Sets the value of a "binary" blind data attribute on multiple components of the mesh. If the data is a sequence of strings then it must provide a value for each component in compIds. If it is a single string then all of the specified components will have their blind data set to that value. |
OpenMaya.MFnMesh.setBoolBlindData | ( | ) |
setBoolBlindData(compId, compType, blindDataId, attr, data) -> self setBoolBlindData(seq of compId, compType, blindDataId, attr, data) -> self The first version sets the value of a 'boolean' blind data attribute on a single component of the mesh. The data must be a single boolean. The second version sets the value of a 'boolean' blind data attribute on multiple components of the mesh. If the data is a sequence of booleans then it must provide a value for each component in compIds. If it is a single boolean then all of the specified components will have their blind data set to that value.
Signature: | setBoolBlindData(compId, compType, blindDataId, attr, data) | ||||||||||||||||||
Parameters: |
| ||||||||||||||||||
Returns: | Reference to self | ||||||||||||||||||
Description: | Sets the value of a "boolean" blind data attribute on a component of the mesh. |
Signature: | setBoolBlindData(compIds, compType, blindDataId, attr, data) | ||||||||||||||||||
Parameters: |
| ||||||||||||||||||
Returns: | Reference to self | ||||||||||||||||||
Description: | Sets the value of a "boolean" blind data attribute on multiple components of the mesh. If the data is a sequence then it must provide a value for each component in compIds. If it is a single value then all of the specified components will have their blind data set to that value. |
OpenMaya.MFnMesh.setColor | ( | ) |
setColor(colorId, MColor, colorSet='', rep=kRGBA) -> self Sets a color in the specified colorSet. If no colorSet is given the current colorSet will be used. If the colorId is greater than or equal to numColors() then the colorSet will be grown to accommodate the specified color.
Signature: | setColor(colorId, color, colorSet='', rep=kRGBA) | |||||||||||||||
Parameters: |
| |||||||||||||||
Returns: | Reference to self | |||||||||||||||
Description: | Sets a color in the specified colorSet. If no colorSet is given the current colorSet will be used. If the colorId is greater than or equal to numColors() then the colorSet will be grown to accommodate the specified color. |
OpenMaya.MFnMesh.setColors | ( | ) |
setColors(seq of MColor, colorSet='', rep=kRGBA) -> self Sets all the colors of the specified colorSet. If no colorSet is given the current colorSet will be used. After using this method to set the color values, you can call assignColors() to assign the corresponding color ids to the geometry. The color sequence must be at least as large as the current color set size. You can determine the color set size by calling numColors() for the default color set, or numColors(colorSet) for a named color set. If the sequence is larger than the color set size, then the color set for this mesh will be expanded to accommodate the new color values. In order to shrink the colorSet you have to clear its existing colors. E.g: clearColors(), setColors( ... ), assignColors()
Signature: | setColors(colors, colorSet='', rep=kRGBA) | ||||||||||||
Parameters: |
| ||||||||||||
Returns: | Reference to self | ||||||||||||
Description: | Sets all the colors of the specified colorSet. If no colorSet is given the current colorSet will be used. After using this method to set the color values, you can call assignColors() to assign the corresponding color ids to the geometry. The color sequence must be at least as large as the current color set size. You can determine the color set size by calling numColors() for the default color set, or numColors(colorSet) for a named color set. If the sequence is larger than the color set size, then the color set for this mesh will be expanded to accommodate the new color values. In order to shrink the colorSet you have to clear its existing colors. E.g:
|
OpenMaya.MFnMesh.setCreaseEdges | ( | ) |
setCreaseEdges(edgeIds, seq of float) -> self Sets the specified edges of the mesh as crease edges. Please note that to make effective use of the creasing variable in software outside of Maya may require a license under patents owned by Pixar(R).
Signature: | setCreaseEdges(edgeIds, creaseData) | |||||||||
Parameters: |
| |||||||||
Returns: | Reference to self | |||||||||
Description: | Sets the specified edges of the mesh as crease edges. Please note that to make effective use of the creasing variable in software outside of Maya may require a license under patents owned by Pixar(R). |
OpenMaya.MFnMesh.setCreaseVertices | ( | ) |
setCreaseVertices(edgeIds, seq of float) -> self Sets the specified edges of the mesh as crease edges. Please note that to make effective use of the creasing variable in software outside of Maya may require a license under patents owned by Pixar(R).
Signature: | setCreaseVertices(vertexIds, creaseData) | |||||||||
Parameters: |
| |||||||||
Returns: | Reference to self | |||||||||
Description: | Sets the specified vertices of the mesh as crease vertices. Please note that to make effective use of the creasing variable in software outside of Maya may require a license under patents owned by Pixar(R). |
OpenMaya.MFnMesh.setCurrentColorSetName | ( | ) |
setCurrentColorSetName(colorSet, modifier=None, currentSelection=None) -> self Sets the 'current' color set for this object. The current color set is the one used when no color set name is specified for a color operation. If the specified color set does not exist then the current color set will not be changed. If 'modifier' (MDGModifier) is provided then the operation will be added to the modifier and will not take effect until the modifier's doIt() is called. Otherwise it will take effect immediately. This method may change the current selection. If the 'currentSelection' (MSelectionList) parameter is provided then the current selection will be saved to it prior to the change. This is useful for supporting full undo of the change. This method is only valid for functionsets which are attached to mesh nodes, not mesh data.
Signature: | setCurrentColorSetName(colorSet, modifier=None, currentSelection=None) | ||||||||||||
Parameters: |
| ||||||||||||
Returns: | Reference to self | ||||||||||||
Description: | Sets the "current" color set for this object. The current color set is the one used when no color set name is specified for a color operation. If the specified color set does not exist then the current color set will not be changed. This method is only valid for functionsets which are attached to mesh nodes, not mesh data. |
OpenMaya.MFnMesh.setCurrentUVSetName | ( | ) |
setCurrentUVSetName(uvSet, modifier=None, currentSelection=None) -> self Sets the 'current' uv set for this object. The current uv set is the one used when no uv set name is specified for a uv operation. If the specified uv set does not exist then the current uv set will not be changed. If 'modifier' (MDGModifier) is provided then the operation will be added to the modifier and will not take effect until the modifier's doIt() is called. Otherwise it will take effect immediately. This method may change the current selection. If the 'currentSelection' (MSelectionList) parameter is provided then the current selection will be saved to it prior to the change. This is useful for supporting full undo of the change. This method is only valid for functionsets which are attached to mesh nodes, not mesh data.
Signature: | setCurrentUVSetName(uvSet, modifier=None, currentSelection=None) | ||||||||||||
Parameters: |
| ||||||||||||
Returns: | Reference to self | ||||||||||||
Description: | Sets the "current" uv set for this object. The current uv set is the one used when no uv set name is specified for a uv set operation. If the specified uv set does not exist then the current uv set will not be changed. This method is only valid for functionsets which are attached to mesh nodes, not mesh data. |
OpenMaya.MFnMesh.setDoubleBlindData | ( | ) |
setDoubleBlindData(compId, compType, blindDataId, attr, data) -> self setDoubleBlindData(seq of compId, compType, blindDataId, attr, data) -> self The first version sets the value of a 'double' blind data attribute on a single component of the mesh. The data must be a single float. The second version sets the value of a 'double' blind data attribute on multiple components of the mesh. If the data is a sequence of floats then it must provide a value for each component in compIds. If it is a single float then all of the specified components will have their blind data set to that value.
Signature: | setDoubleBlindData(compId, compType, blindDataId, attr, data) | ||||||||||||||||||
Parameters: |
| ||||||||||||||||||
Returns: | Reference to self | ||||||||||||||||||
Description: | Sets the value of a "double" blind data attribute on a component of the mesh. |
Signature: | setDoubleBlindData(compIds, compType, blindDataId, attr, data) | ||||||||||||||||||
Parameters: |
| ||||||||||||||||||
Returns: | Reference to self | ||||||||||||||||||
Description: | Sets the value of a "double" blind data attribute on multiple components of the mesh. If the data is a sequence then it must provide a value for each component in compIds. If it is a single value then all of the specified components will have their blind data set to that value. |
OpenMaya.MFnMesh.setEdgeSmoothing | ( | ) |
setEdgeSmoothing(edgeId, smooth=True) -> self Sets the specified edge to be hard or smooth. You must use the cleanupEdgeSmoothing() method after all the desired edges on your mesh have had setEdgeSmoothing() done. Use the updateSurface() method to indicate the mesh needs to be redrawn.
Signature: | setEdgeSmoothing(edgeId, smooth=True) | |||||||||
Parameters: |
| |||||||||
Returns: | Reference to self | |||||||||
Description: | Sets the specified edge to be hard or smooth. You must use the cleanupEdgeSmoothing() method after all the desired edges on your mesh have had setEdgeSmoothing() done. Use the updateSurface() method to indicate the mesh needs to be redrawn. |
def OpenMaya.MFnMesh.setEdgeSmoothings | ( | ) |
setEdgeSmoothings(edgeIds, smooths) -> self Sets the specified edges to be hard or smooth. You must use the cleanupEdgeSmoothing() method after all the desired edges on your mesh have had setEdgeSmoothings() done. Use the updateSurface() method to indicate the mesh needs to be redrawn.
OpenMaya.MFnMesh.setFaceColor | ( | ) |
setFaceColor(color, faceId, rep=kRGBA) -> self Sets the face-vertex color for all vertices on this face.
Signature: | setFaceColor(color, faceId, rep=kRGBA) | ||||||||||||
Parameters: |
| ||||||||||||
Returns: | Reference to self | ||||||||||||
Description: | Sets the face-vertex color for all vertices on this face. |
OpenMaya.MFnMesh.setFaceColors | ( | ) |
setFaceColors(colors, faceIds, rep=kRGBA) -> self Sets the colors of the specified faces. For each face in the faceIds sequence the corresponding color from the colors sequence will be applied to all of its vertices.
Signature: | setFaceColors(colors, faceIds, rep=kRGBA) | ||||||||||||
Parameters: |
| ||||||||||||
Returns: | Reference to self | ||||||||||||
Description: | Sets the colors of the specified faces. For each face in the faceIds sequence the corresponding color from the colors sequence will be applied to all of its vertices. |
OpenMaya.MFnMesh.setFaceVertexColor | ( | ) |
setFaceVertexColor(color, faceId, vertexId, modifier=None, rep=kRGBA) -> self Sets a face-specific normal at a vertex. If 'modifier' (MDGModifier) is provided then the operation will be added to the modifier and will not take effect until the modifier's doIt() is called. Otherwise it will take effect immediately.
Signature: | setFaceVertexColor(color, faceId, vertexId, modifier=None, rep=kRGBA) | ||||||||||||||||||
Parameters: |
| ||||||||||||||||||
Returns: | Reference to self | ||||||||||||||||||
Description: | Sets a face-specific normal at a vertex. |
OpenMaya.MFnMesh.setFaceVertexColors | ( | ) |
setFaceVertexColors(colors, faceIds, vertexIds, modifier=None, rep=kRGBA) -> self Sets the colors of the specified face/vertex pairs. If 'modifier' (MDGModifier) is provided then the operation will be added to the modifier and will not take effect until the modifier's doIt() is called. Otherwise it will take effect immediately.
Signature: | setFaceVertexColors(colors, faceIds, vertexIds, modifier=None, rep=kRGBA) | ||||||||||||||||||
Parameters: |
| ||||||||||||||||||
Returns: | Reference to self | ||||||||||||||||||
Description: | Sets the colors of the specified face/vertex pairs. |
OpenMaya.MFnMesh.setFaceVertexNormal | ( | ) |
setFaceVertexNormal(normal, faceId, vertexId, space=MSpace.kObject, modifier=None) -> self Sets a face-specific normal at a vertex. If 'modifier' (MDGModifier) is provided then the operation will be added to the modifier and will not take effect until the modifier's doIt() is called. Otherwise it will take effect immediately.
Signature: | setFaceVertexNormal(normal, faceId, vertexId, space=MSpace.kObject, modifier=None) | ||||||||||||||||||
Parameters: |
| ||||||||||||||||||
Returns: | Reference to self | ||||||||||||||||||
Description: | Sets a face-specific normal at a vertex. |
OpenMaya.MFnMesh.setFaceVertexNormals | ( | ) |
setFaceVertexNormal(normals, faceIds, vertexIds, space=MSpace.kObject) -> self Sets normals for the given face/vertex pairs.
Signature: | setFaceVertexNormals(normals, faceIds, vertexIds, space=MSpace.kObject) | |||||||||||||||
Parameters: |
| |||||||||||||||
Returns: | Reference to self | |||||||||||||||
Description: | Sets normals for the given face/vertex pairs. |
OpenMaya.MFnMesh.setFloatBlindData | ( | ) |
setFloatBlindData(compId, compType, blindDataId, attr, data) -> self setFloatBlindData(seq of compId, compType, blindDataId, attr, data) -> self The first version sets the value of a 'float' blind data attribute on a single component of the mesh. The data must be a single float. The second version sets the value of a 'float' blind data attribute on multiple components of the mesh. If the data is a sequence of floats then it must provide a value for each component in compIds. If it is a single float then all of the specified components will have their blind data set to that value.
Signature: | setFloatBlindData(compId, compType, blindDataId, attr, data) | ||||||||||||||||||
Parameters: |
| ||||||||||||||||||
Returns: | Reference to self | ||||||||||||||||||
Description: | Sets the value of a "float" blind data attribute on a component of the mesh. |
Signature: | setFloatBlindData(compIds, compType, blindDataId, attr, data) | ||||||||||||||||||
Parameters: |
| ||||||||||||||||||
Returns: | Reference to self | ||||||||||||||||||
Description: | Sets the value of a "float" blind data attribute on multiple components of the mesh. If the data is a sequence then it must provide a value for each component in compIds. If it is a single value then all of the specified components will have their blind data set to that value. |
OpenMaya.MFnMesh.setIntBlindData | ( | ) |
setIntBlindData(compId, compType, blindDataId, attr, data) -> self setIntBlindData(seq of compId, compType, blindDataId, attr, data) -> self The first version sets the value of a 'int' blind data attribute on a single component of the mesh. The data must be a single int. The second version sets the value of a 'int' blind data attribute on multiple components of the mesh. If the data is a sequence of ints then it must provide a value for each component in compIds. If it is a single int then all of the specified components will have their blind data set to that value.
Signature: | setIntBlindData(compId, compType, blindDataId, attr, data) | ||||||||||||||||||
Parameters: |
| ||||||||||||||||||
Returns: | Reference to self | ||||||||||||||||||
Description: | Sets the value of an "int" blind data attribute on a component of the mesh. |
Signature: | setIntBlindData(compIds, compType, blindDataId, attr, data) | ||||||||||||||||||
Parameters: |
| ||||||||||||||||||
Returns: | Reference to self | ||||||||||||||||||
Description: | Sets the value of an "int" blind data attribute on multiple components of the mesh. If the data is a sequence then it must provide a value for each component in compIds. If it is a single value then all of the specified components will have their blind data set to that value. |
OpenMaya.MFnMesh.setInvisibleFaces | ( | ) |
setInvisibleFaces(faceIds, makeVisible=False) -> self Sets the specified faces of the mesh to be visible or invisible. See the getInvisibleFaces() method for a description of invisible faces.
Signature: | setInvisibleFaces(faceIds, makeVisible=False) | |||||||||
Parameters: |
| |||||||||
Returns: | Reference to self | |||||||||
Description: | Sets the specified faces of the mesh to be visible or invisible. See the getInvisibleFaces() method for a description of invisible faces. |
OpenMaya.MFnMesh.setIsColorClamped | ( | ) |
setIsColorClamped(colorSet, clamped) -> self Sets whether the color set's RGBA components should be clamped to the range 0 to 1.
Signature: | setIsColorClamped(colorSet, clamped) | |||||||||
Parameters: |
| |||||||||
Returns: | Reference to self | |||||||||
Description: | Sets whether the color set's RGBA components should be clamped to the range 0 to 1. |
OpenMaya.MFnMesh.setNormals | ( | ) |
setNormals(normals, space=MSpace.kObject) -> self Sets the mesh's normals (user normals).
Signature: | setNormals(normals, space=MSpace.kObject) | |||||||||
Parameters: |
| |||||||||
Returns: | Reference to self | |||||||||
Description: | Sets the mesh's normals (user normals). |
OpenMaya.MFnMesh.setPoint | ( | ) |
setPoint(vertexId, MPoint, space=MSpace.kObject) -> self Sets the position of specified vertex. Note that if you modify the position of a vertex for a mesh node (as opposed to mesh data), a tweak will be created. If you have a node with no history, the first time that a tweak is created, the underlying pointers under the MFnMesh object may change. You will need to call syncObject() to make sure that the object is valid. Subsequent calls to setPoint() on the same object do not require a syncObject() call.
Signature: | setPoint(vertexId, point, space=MSpace.kObject) | ||||||||||||
Parameters: |
| ||||||||||||
Returns: | Reference to self | ||||||||||||
Description: | Sets the position of specified vertex. Note that if you modify the position of a vertex for a mesh node (as opposed to mesh data), a tweak will be created. If you have a node with no history, the first time that a tweak is created, the underlying pointers under the MFnMesh object may change. You will need to call syncObject() to make sure that the object is valid. Subsequent calls to setPoint() on the same object do not require a syncObject() call. |
OpenMaya.MFnMesh.setPoints | ( | ) |
setPoints(points, space=MSpace.kObject) -> self Sets the positions of the mesh's vertices. The positions may be given as a sequence of MFloatPoint's or a sequence of MPoint's, but not a mix of the two.
Signature: | setPoints(points, space=MSpace.kObject) | |||||||||
Parameters: |
| |||||||||
Returns: | Reference to self | |||||||||
Description: | Sets the positions of the mesh's vertices. |
OpenMaya.MFnMesh.setSmoothMeshDisplayOptions | ( | ) |
setSmoothMeshDisplayOptions(MMeshSmoothOptions) -> self Sets the options to use when smoothing the mesh for display.
Signature: | setSmoothMeshDisplayOptions(options) | ||||||
Parameters: |
| ||||||
Returns: | Reference to self | ||||||
Description: | Sets the options to use when smoothing the mesh for display. |
OpenMaya.MFnMesh.setSomeColors | ( | ) |
setSomeColors(colorIds, colors, colorSet='', rep=kRGBA) -> self Sets specific colors in a colorSet. If the largest colorId in the sequence is larger than numColors() then the colorSet will be grown to accommodate the new color values. If you have added new colorIds, you can call assignColors to assign the colorIds to the geometry. If you are modifying existing colors, they will already be referenced by the existing mesh data.
Signature: | setSomeColors(colorIds, colors, colorSet='', rep=kRGBA) | |||||||||||||||
Parameters: |
| |||||||||||||||
Returns: | Reference to self | |||||||||||||||
Description: | Sets selected colors in a colorSet. If the largest colorId in the sequence is larger than numColors() then the colorSet will be grown to accommodate the new color values. If you have added new colorIds, you can call assignColors to assign the colorIds to the geometry. If you are modifying existing colors, they will already be referenced by the existing mesh data. |
OpenMaya.MFnMesh.setSomeUVs | ( | ) |
setSomeUVs(uvIds, uValues, vValues, uvSet='') -> self Sets the specified texture coordinates (uv's) for this mesh. The uv value sequences and the uvIds sequence must all be of equal size. If the largest uvId in the array is larger than numUVs() then the uv list for this mesh will be grown to accommodate the new uv values. If a named uv set is given, the array will be grown when the largest uvId is larger than numUVs(uvSet). If you have added new uvIds, you must call one of the assignUV methods to assign the uvIds to the geometry. If you are modifying existing UVs, you do not need to call one of the assignUV methods.
Signature: | setSomeUVs(uvIds, uValues, vValues, uvSet='') | |||||||||||||||
Parameters: |
| |||||||||||||||
Returns: | Reference to self | |||||||||||||||
Description: | Sets the specified texture coordinates (uv's) for this mesh. The uv value sequences and the uvIds sequence must all be of equal size. If the largest uvId in the array is larger than numUVs() then the uv list for this mesh will be grown to accommodate the new uv values. If a named uv set is given, the array will be grown when the largest uvId is larger than numUVs(uvSet). If you have added new uvIds, you must call one of the assignUV methods to assign the uvIds to the geometry. If you are modifying existing UVs, you do not need to call one of the assignUV methods. |
OpenMaya.MFnMesh.setStringBlindData | ( | ) |
setStringBlindData(compId, compType, blindDataId, attr, data) -> self setStringBlindData(seq of compId, compType, blindDataId, attr, data) -> self The first version sets the value of a 'string' blind data attribute on a single component of the mesh. The data must be a single string. The second version sets the value of a 'string' blind data attribute on multiple components of the mesh. If the data is a sequence of strings then it must provide a value for each component in compIds. If it is a single string then all of the specified components will have their blind data set to that value.
Signature: | setStringBlindData(compId, compType, blindDataId, attr, data) | ||||||||||||||||||
Parameters: |
| ||||||||||||||||||
Returns: | Reference to self | ||||||||||||||||||
Description: | Sets the value of a "string" blind data attribute on a component of the mesh. |
Signature: | setStringBlindData(compIds, compType, blindDataId, attr, data) | ||||||||||||||||||
Parameters: |
| ||||||||||||||||||
Returns: | Reference to self | ||||||||||||||||||
Description: | Sets the value of a "string" blind data attribute on multiple components of the mesh. If the data is a sequence of strings then it must provide a value for each component in compIds. If it is a single string then all of the specified components will have their blind data set to that value. |
OpenMaya.MFnMesh.setUV | ( | ) |
setUV(uvId, u, v, uvSet='') -> self Sets the specified texture coordinate. The uvId is the element in the uv list that will be set. If the uvId is greater than or equal to numUVs() then the uv list will be grown to accommodate the specified uv. If the UV being added is new, thenyou must call one of the assignUV methods in order to update the geometry.
Signature: | setUV(uvId, u, v, uvSet='') | |||||||||||||||
Parameters: |
| |||||||||||||||
Returns: | Reference to self | |||||||||||||||
Description: | Sets the specified texture coordinate. The uvId is the element in the uv list that will be set. If the uvId is greater than or equal to numUVs() then the uv list will be grown to accommodate the specified uv. If the UV being added is new, then you must call one of the assignUV methods in order to update the geometry. |
OpenMaya.MFnMesh.setUVs | ( | ) |
setUVs(uValues, vValues, uvSet='') -> self Sets all of the texture coordinates (uv's) for this mesh. The uv value sequences must be of equal size and must be at least as large as the current UV set size. You can determine the UV set size by calling numUVs() for the default UV set, or numUVs(uvSet) for a named UV set. If the sequences are larger than the UV set size, then the uv list for this mesh will be grown to accommodate the new uv values. After using this method to set the UV values, you must call one of the assignUV methods to assign the corresponding UV ids to the geometry. In order to shrink the uvs array, do the following: clearUVs(), setUVs(...), assignUVs(). These steps will let you to create an array of uvs which is smaller than the original one.
Signature: | setUVs(uValues, vValues, uvSet='') | ||||||||||||
Parameters: |
| ||||||||||||
Returns: | Reference to self | ||||||||||||
Description: | Sets all of the texture coordinates (uv's) for this mesh. The uv value sequences must be of equal size and must be at least as large as the current UV set size. You can determine the UV set size by calling numUVs() for the default UV set, or numUVs(uvSet) for a named UV set. If the sequences are larger than the UV set size, then the uv list for this mesh will be grown to accommodate the new uv values. After using this method to set the UV values, you must call one of the assignUV methods to assign the corresponding UV ids to the geometry. In order to shrink the uvs array, do the following:
These steps will let you to create an array of uvs which is smaller than the original one. |
OpenMaya.MFnMesh.setVertexColor | ( | ) |
setVertexColor(color, vertexId, modifier=None, rep=kRGBA) -> self Sets the color for a vertex in all the faces which share it. If 'modifier' (MDGModifier) is provided then the operation will be added to the modifier and will not take effect until the modifier's doIt() is called. Otherwise it will take effect immediately.
Signature: | setVertexColor(color, vertexId, modifier=None, rep=kRGBA) | |||||||||||||||
Parameters: |
| |||||||||||||||
Returns: | Reference to self | |||||||||||||||
Description: | Sets the color for a vertex in all the faces which share it. |
OpenMaya.MFnMesh.setVertexColors | ( | ) |
setVertexColors(colors, vertexIds, modifier=None, rep=kRGBA) -> self Sets the colors of the specified vertices. For each vertex in the vertexIds sequence, the corresponding color from the colors sequence will be applied to the vertex in all of the faces which share it. If 'modifier' (MDGModifier) is provided then the operation will be added to the modifier and will not take effect until the modifier's doIt() is called. Otherwise it will take effect immediately.
Signature: | setVertexColors(colors, vertexIds, modifier=None, rep=kRGBA) | |||||||||||||||
Parameters: |
| |||||||||||||||
Returns: | Reference to self | |||||||||||||||
Description: | Sets the colors of the specified vertices. For each vertex in the vertexIds sequence, the corresponding color from the colors sequence will be applied to the vertex in all of the faces which share it. |
OpenMaya.MFnMesh.setVertexNormal | ( | ) |
setVertexNormal(normal, vertexId, space=MSpace.kObject, modifier=None) -> self Sets the shared normal at a vertex. If 'modifier' (MDGModifier) is provided then the operation will be added to the modifier and will not take effect until the modifier's doIt() is called. Otherwise it will take effect immediately.
Signature: | setVertexNormal(normal, vertexId, space=MSpace.kObject, modifier=None) | |||||||||||||||
Parameters: |
| |||||||||||||||
Returns: | Reference to self | |||||||||||||||
Description: | Sets the shared normal at a vertex. |
OpenMaya.MFnMesh.setVertexNormals | ( | ) |
setVertexNormal(normals, vertexIds, space=MSpace.kObject) -> self Sets the shared normals for the given vertices.
Signature: | setVertexNormals(normals, vertexIds, space=MSpace.kObject) | ||||||||||||
Parameters: |
| ||||||||||||
Returns: | Reference to self | ||||||||||||
Description: | Sets the shared normals for the given vertices. |
OpenMaya.MFnMesh.sortIntersectionFaceTriIds | ( | ) |
sortIntersectionFaceTriIds(faceIds, triIds=none) -> self Convenience routine for sorting faceIds or face/triangle ids before passing them into the closestIntersection(), allIntersections(), or anyIntersection() methods. When using an acceleration structure with an intersection operation it is essential that any faceId or faceId/triId arrays be sorted properly to ensure optimal performance. Both arguments must be MIntArray's.
Signature: | sortIntersectionFaceTriIds(faceIds, triIds=none) | |||||||||
Parameters: |
| |||||||||
Returns: | Reference to self | |||||||||
Description: | Convenience routine for sorting faceIds or face/triangle ids before passing them into the closestIntersection(), allIntersections(), or anyIntersection() methods. When using an acceleration structure with an intersection operation it is essential that any faceId or faceId/triId arrays be sorted properly to ensure optimal performance. |
OpenMaya.MFnMesh.split | ( | ) |
split(((kOnEdge, int, float), (kInternalPoint, MFloatPoint), ...)) -> self Each tuple in the placements sequence consists of a Split Placement constant followed by one or two parameters. If the Split Placement is kOnEdge then the tuple will contain two more elements giving the int id of the edge to split, and a float value between 0 and 1 indicating how far along the edge to do the split. The same edge cannot be split more than once per call. If the Split Placement is kInternalPoint then the tuple will contain just one more element giving an MFloatPoint within the face. All splits must begin and end on an edge meaning that the first and last tuples in the placements sequence must be kOnEdge placements.
Signature: | split(placements) | ||||||
Parameters: |
| ||||||
Returns: | Reference to self | ||||||
Description: | Each tuple in the placements sequence consists of a Split Placement constant followed by one or two parameters. If the Split Placement is kOnEdge then the tuple will contain two more elements giving the int id of the edge to split, and a float value between 0 and 1 indicating how far along the edge to do the split. The same edge cannot be split more than once per call. If the Split Placement is kInternalPoint then the tuple will contain just one more element giving an MFloatPoint within the face. All splits must begin and end on an edge meaning that the first and last tuples in the placements sequence must be kOnEdge placements. |
OpenMaya.MFnMesh.subdivideEdges | ( | ) |
subdivideEdges(edges, numDivisions) -> self Subdivides edges at regular intervals. For example, if numDivisions is 2 then two equally-spaced vertices will be added to each of the specified edges: one 1/3 of the way along the edge and a second 2/3 of the way along the edge.
Signature: | subdivideEdges(edges, numDivisions) | |||||||||
Parameters: |
| |||||||||
Returns: | Reference to self | |||||||||
Description: | Subdivides edges at regular intervals. For example, if numDivisions is 2 then two equally-spaced vertices will be added to each of the specified edges: one 1/3 of the way along the edge and a second 2/3 of the way along the edge. |
OpenMaya.MFnMesh.subdivideFaces | ( | ) |
subdivideFaces(faces, numDivisions) -> self Subdivides each specified face into a grid of smaller faces. Triangles are subdivided into a grid of smaller triangles and quads are subdivided into a grid of smaller quads. Faces with more than four edges are ignored. The numDivisions parameter tells how many times to subdivide each edge of the face. Internal points and edges are introduced as needed to create a grid of smaller faces.
Signature: | subdivideFaces(faces, numDivisions) | |||||||||
Parameters: |
| |||||||||
Returns: | Reference to self | |||||||||
Description: | Subdivides each specified face into a grid of smaller faces. Triangles are subdivided into a grid of smaller triangles and quads are subdivided into a grid of smaller quads. Faces with more than four edges are ignored. The numDivisions parameter tells how many times to subdivide each edge of the face. Internal points and edges are introduced as needed to create a grid of smaller faces. |
OpenMaya.MFnMesh.syncObject | ( | ) |
syncObject() -> self If a non-api operation happens that many have changed the underlying Maya object attached to this functionset, calling this method will make sure that the functionset picks up those changes. In particular this call should be used after calling mel commands which might affect the mesh. Note that this only applies when the functionset is attached to a mesh node. If it's attached to mesh data the it is not necessary to call this method.
Signature: | syncObject() |
Parameters: | None. |
Returns: | Reference to self |
Description: | If a non-api operation happens that many have changed the underlying Maya object attached to this functionset, calling this method will make sure that the functionset picks up those changes. In particular this call should be used after calling mel commands which might affect the mesh. Note that this only applies when the functionset is attached to a mesh node. If it's attached to mesh data the it is not necessary to call this method. |
|
static |
uniformGridParams(xDiv, yDiv, zDiv) -> MMeshIsectAccelParams Creates an object which specifies a uniform voxel grid structure which can be used by the intersection routines to speed up their operation. This object specifies the number of voxel cells to be used in the x, y, and z dimensions. The grid acceleration structure will be cached with the mesh, so that if the same MMeshIsectAccelParams configuration is used on the next intersect call, the acceleration structure will not need to be rebuilt.
Signature: | uniformGridParams(xDiv, yDiv, zDiv) | ||||||||||||
Parameters: |
| ||||||||||||
Returns: | MMeshIsectAccelParams | ||||||||||||
Description: | Creates an object which specifies a uniform voxel grid structure which can be used by the intersection routines to speed up their operation. This object specifies the number of voxel cells to be used in the x, y, and z dimensions. The grid acceleration structure will be cached with the mesh, so that if the same MMeshIsectAccelParams configuration is used on the next intersect call, the acceleration structure will not need to be rebuilt. |
OpenMaya.MFnMesh.unlockFaceVertexNormals | ( | ) |
unlockFaceVertexNormals(seq of faceIds, seq of vertIds) -> self Unlocks the normals for the given face/vertex pairs.
Signature: | unlockFaceVertexNormals(faceIds, vertexIds) | |||||||||
Parameters: |
| |||||||||
Returns: | Reference to self | |||||||||
Description: | Unlocks the normals for the given face/vertex pairs. |
OpenMaya.MFnMesh.unlockVertexNormals | ( | ) |
unlockVertexNormals(sequence of vertIds) -> self Unlocks the shared normals for the specified vertices.
Signature: | unlockVertexNormals(vertexIds) | ||||||
Parameters: |
| ||||||
Returns: | Reference to self | ||||||
Description: | Unlocks the shared normals for the specified vertices. |
OpenMaya.MFnMesh.updateSurface | ( | ) |
updateSurface() -> self Signal that this polygonal mesh has changed and needs to be redrawn.
Signature: | updateSurface() |
Parameters: | None. |
Returns: | Reference to self |
Description: | Signal that this polygonal mesh has changed and needs to be redrawn. |
|
static |
Name: | kAlpha |
Type: | int |
Description: | Alpha only. |
|
static |
Name: | kDifference |
Type: | int |
Description: | Boolean difference. |
|
static |
Name: | kInstanceUnspecified |
Type: | int |
Description: | Used to specify non-instance-specific UVSets. |
|
static |
Name: | kInternalPoint |
Type: | int |
Description: | Split at a point within a face. |
|
static |
Name: | kIntersection |
Type: | int |
Description: | Boolean intersection. |
|
static |
Name: | kIntersectTolerance |
Type: | float |
Description: | Default tolerance for mesh intersection calculations. |
|
static |
Name: | kInvalid |
Type: | int |
Description: | Invalid placement type. |
|
static |
Name: | kOnEdge |
Type: | int |
Description: | Split at a position along an edge. |
|
static |
Name: | kPointTolerance |
Type: | float |
Description: | Default tolerance when comparing points. |
|
static |
Name: | kRGB |
Type: | int |
Description: | Red, green and blue only. |
|
static |
Name: | kRGBA |
Type: | int |
Description: | Red, green, blue and alpha. |
|
static |
Name: | kUnion |
Type: | int |
Description: | Boolean union. |
|
static |
Controls whether polygons created or added through the functionset are checked for duplicate points.
Name: | checkSamePointTwice |
Type: | bool |
Access: | RW |
Description: | Controls whether polygons created or added through the functionset are checked for duplicate points. |
|
static |
Determines if the mesh's colors are displayed. Attempting to turn color display on when the functionset is attached to mesh data (as opposed to a mesh node) will raise TypeError.
Name: | displayColors |
Type: | bool |
Access: | RW |
Description: | Determines if the mesh's colors are displayed. Attempting to turn color display on when the functionset is attached to mesh data (as opposed to a mesh node) will raise TypeError. |
|
static |
Number of color sets.
Name: | numColorSets |
Type: | int |
Access: | R |
Description: | Number of color sets. |
|
static |
Number of edges.
Name: | numEdges |
Type: | int |
Access: | R |
Description: | Number of edges. |
|
static |
Total number of vertices within faces. Shared vertices are counted for each face which uses them.
Name: | numFaceVertices |
Type: | int |
Access: | R |
Description: | Total number of vertices. Shared vertices are counted for each face which uses them. |
|
static |
Number of per-polygon per-vertex normals.
Name: | numNormals |
Type: | int |
Access: | R |
Description: | number of per-polygon per-vertex normals |
|
static |
Number of polygons (faces).
Name: | numPolygons |
Type: | int |
Access: | R |
Description: | Number of polygons/faces. |
|
static |
Number of UV (texture coordinate) sets.
Name: | numUVSets |
Type: | int |
Access: | R |
Description: | Number of UV sets. |
|
static |
Number of distinct vertices. Shared vertices are only counted once.
Name: | numVertices |
Type: | int |
Access: | R |
Description: | Number of distinct vertices. Shared vertices are only counted once. |