A SimpleMeshMod plug-in is a geometry modifier that can change the topology of the incoming mesh and output the modified result. Available in 3ds Max 2016 and higher.
Examples of similar modifiers are Mirror and Symmetry.
These kinds of modifiers require a modifyMesh handler. The internal mesh value contains the modifier's TriMesh. It is set to the incoming TriMesh value and can be set to a new TriMesh value to produce the modified output.
The internal owningNode value contains the node the modifier is applied to. If the modifier is instanced across multiple nodes, only one of them will be accessible.
The SimpleMeshMod plug-in operates similarly to a scripted Geometry plug-in, but instead of creating a new Geometry object, it operates on the incoming TriMesh on the Modifier Stack.
A scripted Simple Mesh Modifier plug-in is declared by specifying the <superclass> as simpleMeshMod.
The above example implements a simple linear clone modifier. It contains four parameters - the number of copies to create and the offset along each of the three axes.
The on modifyMesh do handler is called whenever the modifier's output requires an update. The internal mesh value is set to the incoming TriMesh from the stack. The script creates a local copy of this TriMesh. Then it loops N-1 times, copies the TriMesh copy again and moves all its vertices according to the offset values multiplied by the number of copies minus 1. Finally, the resulting offset copy of the incoming mesh is added to the internal mesh value. At the end of the handler, the mesh value contains the original TriMesh plus all the copies accummulated into one.