The modifier family of classes can be created and added to an object's modifier stack, using the addModifier function. By making a single modifier and adding it to several objects, you are sharing the modifier between the objects. 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:
$box1.heightsegs -- get creation parameter
$box1.twist -- get the twist modifier
$box1.twist.angle -- the twist's angle
$box1.uvw_map -- to get the 'UVW Map' modifier
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's you can index into:
$box1.modifiers -- get modifier array
$box1.modifiers[2] -- get the 3rd down the list
$box1.modifiers[#twist] -- get the one name 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 can’t use in a MAXScript property name.
The ordering is as you would see in the modifier panel, numbered starting at 1 from top-to-bottom.
All modifiers have a name property:
.name <string> -- get and set modifier name
The following list displays the modifier objects: