Customizing MacroScript Buttons

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 has been 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:

Macro_RCM_EditButtonAppearance.gif

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.

Edit Button Appearance...

The Edit Button Appearance... option opens a new dialog which allows the user to control the appearance of the button including:

Macro_DLG_EditButtonAppearance_Text.gif

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:

Macro_DLG_EditButtonAppearance_Image.gif

Delete Button

The Delete Button option lets the user remove the button from the toolbar. Since this is a destructive operation, a prompt will be issued:

Macro_DLG_DeleteButton.gif

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.

Edit Macro Script

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 Discreet or 3rd parties work.

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:

Macro_MXS_EditScript.gif

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.

Macro_MXS_NoEditScript.gif

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.

Customize...

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:

Macro_DLG_CustomizeUI.gif

 

 

See also

MacroScripts for New Users

Defining Macro Scripts

Creating Icon Bitmap Files

The Macro Recorder