The following methods exposed by the meshOp Struct provide advanced access to the Mesh vertices.
Topic Navigation: | |
---|---|
New Vertices Using Break Chamfer Clone |
Returns the number of vertices in the mesh.
Sets the number of vertices in the mesh. Any new vertices are created at [0,0,0] in the mesh's local coordinate system.
Returns the position of the specified vertex. If <mesh> is a node, or if <mesh> is an Editable Mesh or a Mesh value and node: is specified, the position returned is in the current coordinate system context. If <mesh> is an Editable Mesh or a Mesh value and node: is not specified, the return value is in the mesh's local coordinate system.
<point3_array> meshop.getVerts <Mesh mesh> <vertlist> node:<node=unsupplied>
NEW in 3ds Max 2018.2: Returns an array of the positions of the specified vertices. If <mesh> is a node, or if <mesh> is an Editable Mesh or a Mesh value and node: is specified, the positions returned are in the current coordinate system context. If <mesh> is an Editable Mesh or a Mesh value and node: is not specified, the return values are in the mesh's local coordinate system.
Moves the specified vertices to the specified position. If <mesh> is a node, or if <mesh> is an Editable Mesh or a Mesh value and node: is specified, the position is in the current coordinate system context. If <mesh> is an Editable Mesh or a Mesh value and node: is not specified, the position is in the mesh's local coordinate system.
The positions can be optionally specified as array. In that case, the number of values in pos_array must match the number of vertices specified in vertlist.
If executed in an animation on context or with the AutoKey button checked, animation keys will be created for the vertices of an Editable Mesh. This is not the case with the original setVert() vertex method available since 3ds Max 2.
Available in 3ds Max 2008 and higher. Previously, available in the Avguard Extensions.
This method calculates for each vertex, the sum of the angles of this vertex's corner in each face it is on.
So, for instance, a point lying in the middle of a grid will always have a vertex angle of 2*Pi (6.28319 radians, equal to 360 degrees), whereas a corner of a box will only have 3.0/2*Pi (4.71239 radians, equal to 270 degrees).
Returns an array of size=(#vertices in mesh). The array element for any vertices not specified in <vertlist> will contain the value 0.
meshop.getVertsByColor <Mesh mesh> <color color> <float red_thresh> <float green_thresh> <float blue_thresh> channel:<int=0>
Returns the vertices whose vertex color is within the color range as a <bitarray>. The range values should be in the range of 0 to 255.
meshop.getVertsByColor <Mesh mesh> <point3 uvw> <Float u_thresh> <Float v_thresh> <Float w_thresh> channel: <int=0>
Returns the vertices whose vertex UVW is within the UVW range as a <bitarray>. The range values should be in the range of 0 to 1.
Sets the vertex color for the specified vertices in the specified <mapChannel>.
For each vertex in <vertlist> , N-1 new vertices are created at the same location, where N is the number of faces using that vertex. Each of these faces will use one of these vertices.
Chamfers the specified vertices by the specified amount.
Clones the specified vertices.
Detaches the faces used by the specified vertices.
If delete: is true , the faces are deleted after being detached.
If delete: is false , the faces are not deleted.
If asMesh: is true , the faces are detached and returned as a Mesh value.
If asMesh: is false , the faces are detached as an element in the mesh and a value of OK is returned.
Returns a bitarray of size=(#vertices inmesh) with bits set for all vertices that are hidden.
Sets the specified vertices as hidden, and non-specified vertices as visible.
Returns a bitarray of size=(#vertices in mesh) with bits set for all vertices that are not used by a face.
Returns the minimal distance from <vertIndex> to the vertices specified in <vertlist>.
This function computes distances from selected vertices (as indicated by <vertlist>) to non-selected ones along edge paths. Returns an array of size=(#vertices in mesh). Each element in this array is set to -1 if there is no selection. Otherwise, selected vertices have an array element value of 0; non-selected vertices that are <iterations> or fewer edges away from a selected vertex are assigned the shortest edge-path distance to a selected vertex, and non-selected vertices that are more than <iterations> edges away are set to -1. If <iterations> is 0, the distances are computed from each vertex to the nearest selected vertex, regardless of topology. This is a very expensive algorithm, which takes almost 4 times as long for twice as many vertices. If <iterations> is non-zero, it represents the number of edges one must "travel" in trying to find the nearest selected vertex; this means that it only takes twice as long for twice as many verts. This is like the Edge Distance parameter in EMesh's Soft Selection dialog.
meshop.moveVert <Mesh mesh> <vertlist> {<point3 offset> | <point3 offset_array>} node:<node=unsupplied> useSoftSel:<bool>
Moves the specified vertices by <offset> .
If <mesh> is a node, or if <mesh> is an Editable Mesh or a Mesh value and node: is specified, the offset is in the current coordinate system context.
If <mesh> is an Editable Mesh or a Mesh value and node: is not specified, the offset is in the mesh's local coordinate system.
In 3ds Max 2008 and higher, this method allows the position to be specified as array. In that case, the number of values in pos_array must match the number of verts specified in vertlist. This feature was previously available in the Avguard Extensions.
If useSoftSel: is true, and the mesh's soft selection data channel is present, the specified offsets are multiplied by the vertex's soft selection value.
meshop.moveVertsToPlane <Mesh mesh> <vertlist> <point3 normal> <float offset> node:<node=unsupplied>
Moves the specified vertices into the specified plane. The target plane is defined as all points which when DotProd'd with N, return the specified offset.
All vertices are moved along the normal vector N.
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.
Welds the specified vertices that are within the threshold distance.
Renamed to meshOp. weldVertSet .
If weldpoint: is specified, the resulting vertex is positioned at the supplied point.
If weldpoint: is not specified, the resulting vertex is positioned at the average location of the specified vertices.
If <mesh> is a node, or if <mesh> is an Editable Mesh or a Mesh value and node: is specified, the position is in the current coordinate system context.
If <mesh> is an Editable Mesh or a Mesh value and node: is not specified, the position is in the mesh's local coordinate system.