Since the introduction of the MacroRecorder and MacroScripts in 3ds Max 3, a fair amount of User Interface elements have been implemented using MAXScript.
In 3ds Max 4, a unified ActionItems system was introduced which allows MacroScripts to appear in all four major areas of the customization dialog - Keyboard Shortcuts, Toolbars, Menus and QuadMenus.
In the case of Toolbar buttons, MacroScripts provide a context-sensitive right-click menu with the following options:
In this example, the user right-clicked the second icon of the Render Shortcuts toolbar which contains the Render Presets Slot B used to quickly assign Render Presets to the current Production renderer.
The Edit Button Appearance... option opens a new dialog whitewalls the user to control the appearance of the button including:
The Tooltip to be displayed when the mouse rolls over the button,
The image file and the icon number to be used when an Image Button is desired.
This is the default appearance of the dialog. Eventhough the button is currently showing an icon (specified in the source code of the script), the dialog will provide the Text Button settings as the default state.
The user can switch the button mode to Image Button, select an icon library from the drop-down list (for example, "Render"), and select a new icon from the list:
The Delete Button option lets the user remove the button from the toolbar. Since this is a destructive operation, a prompt will be issued:
Even after answering with Yes, the original Toolbar definition could be restored from a CUI file, or the deleted button could be re-created by using the Customize User Interface dialog.
The Edit Macro Script option lets the user navigate directly to the source code of the MacroScript used for the button's definition. This can be very useful for quickly changing small errors in the functionality and for learning how certain features developed by Autodesk or 3 rd parties work.
Note that opening a "factory" MacroScript that ships with 3ds Max will copy the file from the \macroscripts folder to the \usermacros folder in the current user's Local AppData folder to allow custom changes to the code. Scripts placed in the \usermacros folder will be evaluated after the factory scripts and will thus override them. The following warning will be shown by default (unless disabled via the checkbox option in the lower left corner):
For example, this is the MAXScript Editor showing the source code of the Render Presets Slot B button - note the first line of the MacroScript is automatically highlighted:
If the button is NOT implemented using MAXScript, the Edit Macro Script option will be grayed out. See for example the Manipulate button in the Main Toolbar.
Some buttons implemented in the core of 3ds Max will not allow the user to change their appearance (see most of the buttons on the Main Toolbar like Material Editor, Render etc.). These buttons will not provide a right-click context menu at all.
The Customize... option opens the standard Customize User Interface dialog and lets the user create new buttons, assign ActionItems to shortcuts, place them on Menus and QuadMenus, and tweak the colors of the User Interface.It also provides the option to locate and edit MacroScripts for those items that have been created using MAXScript: