The Modifier and SpacewarpModifier families of classes can be created and added to an object’s modifier stack using the addModifier() or modPanel.addModToSelection() methods. Unless otherwise noted, the term modifier will be used to mean members of either class.
By making a single modifier and adding it to several objects, you are sharing the modifier between the objects, as you would by applying a modifier to a selection of objects in the 3ds Max user interface. The constructors in the following classes can take any of the listed properties as optional keyword arguments with the defaults as shown.
Existing modifiers can be accessed in two ways:
Modifiers can be accessed as a property of a node.
When you access properties on a <node> scene object such as, its name, position, length, and so on, MAXScript will also consider modifiers on the object to be properties, for example:
$box001.heightsegs --get creation parameter $box001.twist --get the twist modifier $box001.twist.angle --the twist’s angle
You can then access modifier properties as sub-properties on the modifier as shown. If the modifier name has spaces in it, you can use underscore ‘_’ as space convention that pathnames use as follows:
The property access described above will work in simple situations, but there might be several modifiers with the same name, or a modifier with the same name as a creation parameter (the latter is always looked for first).
In this situation, you can use the modifier array mechanism, which yields an array of modifiers you can index into in several ways:
b = box() $box001.modifiers --get the array or modifiers $box001.modifiers[3] --get the 3rd modifier counted from top of the list $box001.modifiers[#twist] --get the modifier named "twist" using name literal $box001.modifiers["ffd 4x4x4"] --get the FFD named "ffs 4x4x4" using string $box001.modifiers[bend] --get the Bend by class (Added in 3ds Max 2013)
You can use a for loop over the .modifiers array to go through all existing modifiers and check their name, class, and properties to find the one you need.
You can access a modifier in the .modifiers array by its index.
The modifiers are listed as shown in the Modifier stack, indexed from top to bottom, starting with 1.
If the index is out of range, either higher than the number of modifiers in the array or less than 1, the value of undefined will be returned.
You can access a modifier in the .modifiers array by a name literal.
Use underscore ‘_’ in place of spaces in the name like with properties access.
If two modifiers have the same name, the top-most will be returned.
If a modifier with the specified name does not exist in the array, the value of undefined will be returned.
You can access a modifier in the .modifiers array by a name string.
The name string access is case-insensitive.
If two modifiers have the same name, the top-most will be returned.
If a modifier with the specified name does not exist in the array, the value of undefined will be returned.
In 3ds Max 2013 and higher, you can access a modifier in the .modifiers array using its class instead of its name.
If two modifiers have the same class, the top-most will be returned.
If a modifier with the specified class does not exist in the array, the value of undefined will be returned.
The classes derived directly from the Modifier and SpacewarpModifier classes are described in Modifier and SpacewarpModifier Types.
The properties, operators, and methods that are common to all classes derived directly from the Modifier and SpacewarpModifier classes are described in Modifier Common Properties, Operators, and Methods.
The Modifier and SpacewarpModifier classes are derived from the MAXWrapper class, and inherits the properties and methods defined for that class. These properties and methods are described in MAXWrapper Common Properties, Operators, and Methods.