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:
As a property access on a <node>. When you access a property on a <node> scene object, such as its name or position, or length, MAXScript will also consider modifiers on the object to be properties, for example:
$box1.heightsegs-- get creation parameter $box1.twist-- get the twist modifier $box1.twist.angle-- the twist’s angle
You can then access modifier properties as subproperties on the modifier as shown. If the modifier name has spaces in it, you can use the ‘_’ as space convention that pathnames use, like this:
This will work in simple situations, but there may be several modifiers with the same name, or a modifier with the same name as a creation parameter (which 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:
$box1.modifiers--get modifier array $box1.modifiers[3]-- get the 3rd down the list $box1.modifiers[#twist]-- get the one named "twist" $box1.modifiers["ffd 4x4x4"]-- get the FFD
As you can see from the examples, you can use both name literals and strings to index modifiers by name in the table, so this is a way to get at modifiers with characters you cannot use in a MAXScript property name.
The ordering is as you would see in the Modify panel, numbered starting at 1 from top-to-bottom.
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.