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 > [node:<node>] [ui:<boolean>]

Sets the specified object to be the active object in the modifier stack. The Modify panel must be open, otherwise the function does nothing.

If node: is specified, the modifier or base object will be searched for only in the specified node. This is typically specified when you know what node to look in, and the modifier or base object is instanced in another node. If the argument is a node, the node keyword argument defaults to that node.

If ui: is set to true, the Command Panel will be switched to Modify mode. The default is false.

 

modPanel.validModifier (< modifier > | < modifier_class >).

Returns true if Modify panel is open, one or more nodes are selected, and the specified modifier is applicable to all the nodes at their current edit level in the stack.

In 3ds Max 6 and higher,

the validModifier method will return false if either the node/node collection or modifier/modifier class is 'undefined', or the node collection is empty.

 

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.

 

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.

The following methods can also be used to get and set the sub-object level:

getSelectionLevel <maxobject>

Get the subObject level of MAXObject. If MAXObject is a node, this method operates on the base object. This method is applicable to base editables and select and edit modifiers.

Note:

This method does not work with SplineSelect and PatchSelect modifier.

 

setSelectionLevel <maxobject> {#object | #vertex | #edge | #face}

Set the subObject level of MAXObject. If MAXObject is a node, this method operates on the base object. This method is applicable to base editables and select and edit modifiers.

Note:

This method does not work with SplineSelect and PatchSelect modifier.