The following methods provide basic access the to Mesh vertices and vertex normals.
Returns number of vertices as an integer, equivalent to using <mesh>.numverts.
Set the number of vertices as specified. If the optional boolean argument is true , the existing topology remains intact. If it is false or left off, the topology is lost.
When setting the number of vertices using the numVerts property or the setNumVerts method, the new vertices are initialized to [0.,0.,0.]
Returns the position (in the current working coordinate system) of the indexed vertex as a point3
Sets the position coordinates of the indexed vertex as a point3 value, or 3 floats - X,Y,Z
Deletes the indexed vertex from the mesh and all faces that share the vertex. Renumbers vertices and faces to account for the deletions. Also adjusts face vertex indexes as necessary.
Returns the normal at the indexed vertex's position as a point3. The normal is based on the faces that use the vertex and the smoothing groups assigned to those faces.
Sets the indexed vertex's normal vector.
Since 3ds Max 2015, setting a vertex normal sets the normal as Explicit, so it will retain its value when the mesh gets updated. In versions prior to 3ds Max 2015, setting the vertex normal using MAXScript had only a very short lasting effect because the data would be easily overwritten by the Smoothing Group-based implicit normal recalculation on viewport redraw or scene rendering.
Returns the current vertex selection set, or the specified named selection set if the optional name: parameter is specified, as a BitArray. The optional <modifier_or_index> identifies the Edit Mesh, Mesh Select, or Poly Select modifier on the given scene object from which the selection BitArray is obtained.
If the optional <modifier_or_index> argument is not supplied, the <node> must be an Editable Mesh object and the selection is taken from the top of the modifier stack. If <modifier_or_index> is supplied, it must be either a modifier on the node or a number. If it is a modifier, it must be either an Edit Mesh or a Mesh Select modifier. If it is a number, it is used as an index into the Edit Mesh/Select Modifiers on the <node> starting from the top of the stack.
The index does not count any other types of modifier present! So, an index of 1 will always get the selection currently active at the top of the stack.
The function returns a BitArray with bits set for the 1-based indices of the currently selected vertices, or the vertices specified by the named selection set, in the object by the given modifier.
setVertSelection <node> [<modifier_or_index>]( <sel_bitarray> | <sel_array> ) [name:<name>] [keep:<boolean>] setVertSelection <mesh> ( <sel_bitarray> | <sel_array> )[keep:<boolean>]
Sets the vertex selections in an Editable Mesh base object, Mesh Select modifier, Edit Mesh Modifier, Poly Select Modifier, or TriMesh. This mirrors the selection getting method above.
The <modifier_or_index> argument is interpreted as for the get- form above, except that only the Mesh Select and Poly Select modifiers are supported for set operations.
If the optional name: argument is specified, the vertices in the specified named selection set in the Editable Mesh or Mesh Select modifier are selected. If the name: argument is not specified, the selection index argument gives the indexes of the sub-object items to be selected as either a BitArray or an array of integers. If the optional keep: keyword argument is false or not supplied, any current selection will be replaced by the new one. If the keep: keyword argument is true , the new selection is added to the current selection. The name: argument is not applicable to TriMeshes.
Use the mesh update() function after making a group of selection changes in order to make them visible to any modifiers on the object.
Returns the average position (center) of the selected vertices in the given mesh as a Point3. If the object is not a mesh this method returns undefined. If no vertices are selected in the mesh, a value of [0,0,0] is returned. This method is not applicable to TriMeshes.
Returns the normalized average of the normals of the selected vertices in the given mesh as a Point3. If the given node is not a mesh, it returns undefined. If no vertices are selected in the mesh, or the averaged normal is [0,0,0], a value of [1,0,0] is returned. This method is not applicable to TriMeshes.
The vertex normals used in this method do not consider smoothing group data of the faces that use the vertex.