Modify Panel

The following methods are associated with the Modify panel:

enableShowEndRes <boolean>

If the boolean parameter is true, allows the Show End Result On/Off Toggle icon to remain pressed in. If false, the Show End Result On/Off Toggle icon will return to the off state after being pressed. This method must be used in true/false pairs, as its effect is "sticky" when selecting other objects or modifiers, or when switching away from and back to the Modify panel.

IsSubSelEnabled()

Returns true if the user is allowed to enter Sub-Object mode, false otherwise.

enableSubObjSel <boolean>

If the boolean parameter is true, allows the user to enter Sub-Object mode for those objects/modifiers that have Sub-Object modes defined. If false, the Sub-Object button is disabled. This method must be used in true/false pairs, as its effect is "sticky" when selecting other objects or modifiers, or when switching away from and back to the Modify panel.

modPanel.addModToSelection <modifier>

Applies a modifier to the current selection opened in the Modify panel. It should be used in place of addModifier() in places where the target is a selection or group or where you have the stack open at a particular place in the Modify panel with a sub-object selection active and you want the modifier applied to that selection. addModifier() adds the modifier separately to each object in the selection or group and does not honor the current active sub-object selection in all cases. The Modify panel must be open on the selection you want to apply the modifier to, otherwise the function does nothing.

modPanel.getCurrentObject()

Returns the modifier or base object currently selected in the Modify panel stack. If the Modify panel is not open, this function returns undefined.

modPanel.getModifierIndex <node> <modifier>

Returns the index of the given modifier in the modifier stack for the given node. This index corresponds to the modifiers position in the <node>.modifiers array. This function returns undefined if the given modifier is not in the node's modifier stack.

modPanel.setCurrentObject < modifier | node | node_baseobject >

Sets the specified object in the current modifier stack to be the active object in the modifier stack. The Modify panel must be open on the object containing the modifier or base object to be selected, otherwise the function does nothing.

Examples:

modPanel.addModToSelection (bend()) -- apply bend modifier to current selection

modPanel.getModifierIndex $ foo          -- returns index of modifier foo

modPanel.setCurrentObject $              -- open on base object

modPanel.setCurrentObject $.baseObject   -- same as above

modPanel.setCurrentObject $.taper        -- open on taper modifier in object

modPanel.setCurrentObject $.modifiers[3] -- open on 3rd modifier

modPanel.setCurrentObject foo            -- open on foo object or modifier

The following 3ds max system global variables are associated with the Modify panel:

numSubObjectLevels

Lets you get the number of sub-object levels supported by the object or modifier currently selected in the modifier stack. If the Modify panel is not open or no objects are selected, the global contains the value undefined.

subObjectLevel

Lets you get and set the sub-object level in the Modify panel if it is open. An Integer value of zero or greater up to the number of sub-object levels supported by the currently open modifier, typically in the order shown in the Sub-Object drop-down list. A subObjectLevel of 0 means sub-object mode is off. If the Modify panel is not open or sub-object level setting not permitted in the current modifier, the global contains the value undefined. For example:

b=box() -- create a box

em=edit_mesh() -- create an Edit Mesh modifier

addModifier $box01 em -- add edit mesh mod

max modify mode -- open mod panel

select $box01 -- select object box01

print subObjectLevel -- print the current subobject level

subObjectLevel = 2 -- set sub-object level to Edge

showEndResult

Lets you get and set the state of the Show End Result Toggle icon in the Modify panel. A Boolean Value û true if Show End Result is on, false if off.