The following methods provide advanced access to the Mesh, affecting multiple faces at a time.
Creates a set of faces using the specified vertices. The order of the vertices in the faces is the order in the vertex array. The polygon may be nonconvex, but should be (roughly) coplanar.
smGroup: and matID: specify the smoothing group data and material ID number assigned to the new faces.
meshop.cut <Mesh mesh> <int edge1Index> <float edge1f> <int edge2Index> <float edge2f> <point3 normal> fixNeighbors:<boolean=true> split:<boolean=true> node:<node=unsupplied>
Cuts the mesh from a point on one edge to a point on another, along a line drawn by looking at the mesh from a particular viewpoint.
<edge1Index> specifies the edge that the cut starts on.
<edge1f> specifies the fractional distance along the edge to start the cut from.
<edge2Index> specifies the edge that the cut ends on.
<edge2f> specifies the fractional distance along the edge to finish the cut on.
<normal> specifies the direction of view. The cut will take place on this "side" of the mesh, in the plane formed by this vector and the direction from the start to the end.
If fixNeighbors: is true , the faces on the other side of each end of the cut should be split to prevent splits at the ends. If split: is true , the cut will split the mesh apart. If false , the cut will just refine the mesh by adding geometry. If <mesh> is a node, or if <mesh> is an Editable Mesh or a Mesh value and node: is specified, the normal is in the current coordinate system context. If <mesh> is an Editable Mesh or a Mesh value and node: is not specified, the normal is in the mesh's local coordinate system.
meshop.slice <Mesh mesh> <facelist> <point3 normal> <float offset> separate:<boolean=false> delete:<boolean=false> node:<node=unsupplied>
Slices the mesh along the specified slicing plane. The slicing plane is defined as all points which, when DotProd'd with <normal>, return <offset>. <normal> should be normalized.
separate: specifies whether the slice should separate the mesh into two separate elements ( true ) or just refine the existing mesh by splitting faces ( false ).
delete: specifies whether the slice should remove the portion of the mesh "below" the slicing plane, where "below" is defined as the area where DotProd (p, <normal>) - <offset> < 0. If delete: is true , separate: is ignored. If <mesh> is a node, or if <mesh> is an Editable Mesh or a Mesh value and <node> is specified, the normal is in the current coordinate system context. If <mesh> is an Editable Mesh or a Mesh value and node: is not specified, the normal is in the mesh's local coordinate system.
meshop.getPolysUsingVert <Mesh mesh> <vertlist> ignoreVisEdges:<boolean=false> threshhold:<float=45.>
Returns a bitarray of size=(#faces in mesh) with bits set for all faces that are in'polygons'containing the specified vertices. The definition of a polygon is all faces sharing invisible edges with edge angles below the threshhold angle. The default threshhold angle is 45 degrees. If ignoreVisEdges is set to true, the edge visibility is ignored but the threshhold is still relevant.
meshop.optimize <Mesh mesh> <float normalThreshold> <float edgeThreshold> <float bias> <float maxEdge> saveMatBoundries:<boolean=true> saveSmoothBoundries:<boolean=true> autoEdge:<boolean=true>
Reduces the mesh in complexity by reducing the number of faces based on a surface normal threshold. Adjacent faces whose difference in surface normal angle falls below <normalThreshold> will be collapsed into a single triangle. If autoEdge: is true, when the angle between adjacent surface normals is less than <edgeThreshold> the edge will be invisible. When optimizing mesh objects, as the optimization increases, you can get lots of long skinny 'degenerate' triangles (that cause rendering artifacts). Increasing <bias> keeps triangles from becoming degenerate. The range of values is from 0 to 1 (where 0 turns bias off). Values close to 1 reduce the amount of optimization in favor of maintaining equilateral triangles. A <maxEdge> value > 0 will prevent the optimize function from creating edges longer than this value. If this parameter is <=0 no limit is placed on the length of the edges. If saveMatBoundries: is true, faces won't be collapsed across a material boundary. If saveSmoothBoundries: is true, faces won't be collapsed across a dissimilar smoothing group boundary.
Yields a copy of the source TriMesh.
Clears out the TriMesh's geometry and topology, effectively freeing its memory.
Applies controllers to the specified vertices of the Editable_Mesh, where <vertex_spec> is one of:
By assigning controllers to the vertices, the vertices are added to the Master subAnim and appear as animatables in the Track View, allowing further scripting of the vertices.
The vertices to be animated are specified by index number or with the keyword #all to animate all vertices.
See also Class and Object Inspector Functions and Scripting Vertex and Control Point Animation for details on accessing the Editable_Mesh vertices. The controller values assigned to the vertices is in object space. See Using Node Transform Properties for information on converting between world space to object space.
The setMesh() method enables bulk changes to a mesh via arrays of vertices, faces, tverts, etc. setMesh() has the following forms:
Resets the mesh to the given geometry but with no topology (i.e., no faces or edges). Any current mesh data is lost. You have to individually place the vertices and create the faces from the vertices. The default number of vertices and faces are 36 and 50, respectively.
setMesh <mesh> [ vertices:<array_of_point3s> ] [ faces:<array_of_point3s> ] [ materialIDs:<array_of_integers> ] [ tverts:<array_of_point3s> ]
Resets the mesh based on the given arrays. Only those portions of the mesh that are specified are reset. For example, if only the vertices: parameter is specified, the existing face data is retained. Each Point3 value in the vertices array specifies the position of the vertex in the current coordinate system. Each Point3 value in the faces array specifies the 3 vertex indices that form the face. The materialIDs array specifies the material ID to be assigned to each face. Each Point3 value in the tverts array specifies the UVW coordinates of the texture vertices. See Texture Mapping in the methods section for more information on texture vertices.
setMesh <mesh> [ length:<integer> ] [ width:<integer> ] [ lengthsegs:<integer> ] [ widthhsegs:<integer> ]
Resets the mesh with a flat rectangular mesh with the given size and number of segments. The default length and width are 50, the default number of segments is 5.