Main Toolbar
 
 
 

The following methods are associated with 3ds Max’s main toolbar:

Methods

enableUndo <boolean> 	 

Enables or disables the Undo icon.

In 3ds Max 2010 and higher, the Undo icons are no longer on the Main Toolbar, but are still affected by this method. When the argument is false, the Undo and Redo icons will cause no action if pressed.

   

hitByNameDlg()   

Opens the standard 3ds Max Select By Name dialog allowing users to select objects.

Returns false if the user cancels out of the Select by Name dialog, true otherwise.

See also Picking Scene Nodes by Name for a MAXScript method with more control over the filtering and display of the dialog.

toolMode.uniformScale() 

Set scale mode to Uniform Scale.

   

toolMode.nonUniformScale() 

Set scale mode to Non-uniform Scale.

   

toolMode.squashScale() 

Set scale mode to Squash.

   

toolMode.coordsys { <mode_name> | <node> } 

Sets the Reference Coordinate System.

Valid <mode_name> values are:

#view#screen#world#parent#local#grid

   

getRefCoordSys() setRefCoordSys <mode_name> 

Get and set the Reference Coordinate System.

Valid <mode_name> values are:

   

#hybrid -- View 
#screen -- Screen 
#world -- World 
#parent -- Parent 
#local -- Local 
#object -- Pick object or Grid - not valid for setRefCoordSys() 

   

enableRefCoordSys <boolean> 

Enables or disables the Reference Coordinate System drop-down list.

   

getCoordCenter() setCoordCenter <name> 

Get and set the Coordinate System Center.

Valid <name> values are:

   

#local -- Use Pivot Point Center 
#selection -- Use Selection Center 
#system -- Use Transform Coordinate Center 

   

enableCoordCenter <boolean> 

Enables or disables the Coordinate System Center icon.

   

toolMode.pivotCenter() 

Sets Coordinate System Center to Pivot Point Center.

   

toolMode.selectionCenter() 

Sets Coordinate System Center to Selection Center.

   

toolMode.transformCenter() 

Sets Coordinate System Center to Transform Coordinate Center.

   

getNumAxis() 

This method reflects the Coordinate System Center state.

If it is set to Pivot Point Center then this method returns #individual otherwise #all.

   

setToolBtnState<name> <boolean>

Set the specified tool buttons on or off.

This method does not put into the mode, it just changes the state of the tool button.

This method does not change the state of any button other than the specified button.

To set the actual tool mode, please see toolmode.commandmode

The valid <name> values are:

   

#move -- Move button on/off 
#rotate -- Rotate button on/off 
#nuscale -- Scale button on/off - doesn’t change scale type 
#uscale -- Scale button on/off - doesn’t change scale type 
#squash - Scale button on/off - doesn’t change scale type 
#select - Select button on/off 

   

getToolbtnState <name> 

Returns whether the specified tool button is on or off as a <boolean> value.

To get the actual tool mode, please see toolmode.commandmode

Valid name values are:

   

#select#move#rotate#uscale -- returns true if any of the scale button states is on #nuscale -- returns true if any of the scale button states is on #squash -- returns true if any of the scale button states is on 

The following methods deal with the Named Selection Set drop-down list. These methods are not intended for casual usage.

   

clearCurSelSet() 

Clears the edit field of the Named Selection Set drop-down list.

Does not deselect the currently selected objects.

   

clearSubSelSets() 

Clears the named selections from the Named Selection Set drop-down list.

The named selection sets still exist, they just don’t show in the drop-down list.

This command can be dangerous to use unless you are in Sub-Object mode in the Modify panel, as there is not a direct method to rebuild the Named Selection Set list.

When in Sub-Object mode in the Modify panel, the namedSelSetListChanged() method will rebuild the list.

   

namedSelSetListChanged() 

When in Sub-Object mode in the Modify panel, this method will rebuild the named selection set list.

   

setCurNamedSelSet <string> 

Sets the edit field of the Named Selection Set drop-down list to the specified string.

This method not change the current selection set or add the specified string to the named selection set list.

   

appendSubSelSet <string> 

Appends the specified string to the Named Selection Set drop-down list.

This method not change the current selection set.

Modifiers in 3ds Max use this method to add sub-object named selection sets to the Named Selection Set drop-down list.

This is done whenever the selection level changes.

The following 3ds Max system global variables are associated with the Main Toolbar:

   

preferences.constantReferenceSystem

Lets you get and set whether to use a constant Reference System for the Move, Rotate, and Scale tools.

A Boolean value - true if Constant is on, false if off.

This variable matches the Constant check box in Customize menu > Preferences > General > Reference Coordinate System.

   

toolmode.commandmode

Get/set the 3ds Max command mode.

The value of the command mode is a <name> value if the command mode is a recognized command mode, otherwise the return value is an integer value.

The recognized command modes are:

   

#SELECT#MOVE#ROTATE#NUSCALE#USCALE#SQUASH#VIEWPORT#HIERARCHY#CREATE#MODIFY#MOTION#ANIMATION#CAMERA#NULL#DISPLAY#SPOTLIGHT#PICK

When setting the 3ds Max command mode, only the following command modes are valid:

#SELECT#MOVE#ROTATE#NUSCALE#USCALE#SQUASH

   

toolmode.commandmodeID

Get the 3ds Max command mode as Integer ID.

Read-only.

Possible values are:

1 - Move

2 - Rotate

3 - Non-Uniform Scale

4 - Uniform Scale

5 - Squash Scale

6 - Select

   

toolmode.axisConstraints

Get/set the 3ds Max axis constraints.

The axis constraints values are:

   

#X#Y#Z#XY#YZ#ZX

   

toolMode.coordSysNode

A read/write variable containing a node value or undefined.

This variable reflects which node, if any, is the current reference coordinate system node.

Assignment to this variable must be a node value.

   

manipulateMode

Get/set the 3ds Max manipulate mode. When true, manipulate mode is active.

The following method affects all toolbars.

   

updateToolbarButtons() 

Forces an update of all toolbar button states.

   

See Also