MAXScript Tools and Interaction with 3ds Max > Interacting with the 3ds Max User Interface > Command Panels >

# Modify Panel

The following methods and system globals are associated with the Modify panel:

### Pin Stack Button

    modpanel.getPinStack()

Returns true if the Pin Stack button is pressed, false if not pressed or not in Modify panel.

Available in 3ds Max 2010 and higher.

    modpanel.isPinStackEnabled()

Returns true if the Pin Stack button is enabled, false if not enabled or not in Modify panel.

Available in 3ds Max 2010 and higher.

    modpanel.setPinStack <bool		>

Sets the Pin Stack button to the specified stateas long as the Pin Stack button is enabled.

Available in 3ds Max 2010 and higher.

### Show End Result Button

    enableShowEndRes <boolean>

This method sets the checkbutton/button behavior of the Show End Result icon.

If the boolean parameter is true , the Show End Result button to be allowed to remain pressed in, thus behaving as a checkbutton.

If the boolean parameter is false , the Show End Result button will return to the off state after being pressed, behaving as a button.

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.

    showEndResult

A 3ds Max system global variable which lets you get and set the state of the Show End Result Toggle icon in the Modify panel. It contains a Boolean value - true if Show End Result is on, false if it is off.

### Sub-Object Selection

    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.

    IsSubSelEnabled()

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

    numSubObjectLevels

A read-only 3ds Max system global variable which 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 variable contains the value undefined .

    subObjectLevel

A 3ds Max system global variable which lets you get and set the sub-object level in the Modify panel if it is open.

The value is an Integer 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 variable 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
    print subObjectLevel -- print the current subobject level
    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
OUTPUT
    $Box:Box01 @ [0.000000,0.000000,0.000000]
    Edit_Mesh:Edit Mesh
    OK
    undefined
    undefined
    OK
    OK
    0
    0
    2

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.

NoteThis 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.

NoteThis method does not work with SplineSelect and PatchSelect modifier.

### Add Modifier To Selection

    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. See Node Common Properties - Modifier Stack Related Methods for more.

The Modify panel must be open on the selection you want to apply the modifier to, otherwise the function does nothing.

### Accessing Modifier Panel Objects

    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 . Use the max modify mode command to switch to the Modify panel.

    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.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.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 modPanel.validModifier method will return false if either the node/node collection or modifier/modifier class is 'undefined', or the node collection is empty.

EXAMPLE
    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

#### See Also

- Command Panels

- Create Panel

- 3ds Max System Globals

- Node Common Properties, Operators and Methods - Modifier Stack Related Methods