MAXScript Introduction > Accessing MAXScript >

# The Macro Recorder

The MAXScript Macro Recorder captures many of the actions performed by the user, and generates the MAXScript commands that correspond to those actions.

Output from Macro Recorder is displayed in the pink Macro Recorder pane of the MAXScript Listener window:

## MacroRecorder Listener Menu

Several filtering options are available that control what types of user actions are recorded, whether the generated MAXScript commands contain explicit object references or are selection-relative, and whether the generated MAXScript commands contain explicit or relative transforms and coordinates.

These options are set using the MacroRecorder menu in the Listener window:

## Macro Recorder Preferences

The default option settings are specified in the MAXScript page of the 3ds Max Preferences dialog, as described in the MAXScript Preferences Settings topic in the 3ds Max User Reference.

These settings can also be changed or set by editing the [MAXScript] section of the 3dsmax.ini file.

## Macro Recorder Limitations

While many areas in 3ds Max generate Macro Recorder output, there are also many areas that do not.

In general, most of the buttons on the 3ds Max menu bar, toolbars, status bar, Create panel, and Modify panel will generate Macro Recorder output.

If the button invokes a secondary dialog, changing setting or performing actions in the secondary dialog typically will not generate Macro Recorder output.

In the Create and Modify panels, Macro Recorder output will be generated if the object or modifier can be created by MAXScript.

In some cases, the plug-in implementing an object or modifier has not been updated to support Macro Recorder, so that object or modifier will not generate Macro Recorder output.

## Macro Recorder Drag And Drop Onto Toolbars

MAXScript supports text drag-and-drop onto toolbars to create Macro Script buttons.

You can select and drag text from any text window, such as Listener window panes or Editor windows, onto any visible toolbar.

The cursor changes to an arrow with a + sign when it is OK to drop the text.

If you drop it, a Macro Script button is added to the toolbar with the dropped text as the body of the Macro Script.

The classic case here would be to drag text from the Macro Recorder pane onto a toolbar to make a button that does the sequence of events just recorded. For more information, see Defining Macro Scripts.

## Macro Recorder Options

The following Macro Recorder menu commands are available in the Listener:

Enable

  When Enable is selected the Macro Recorder will generate MAXScript commands.

Explicit Scene Object Names/Selection-Relative Scene Object Names

  Specifies whether to use explicit scene object names or the selection set token in the generated commands if only one object is selected.

  If more than one object is selected, the selection set token is always used.

  FOR EXAMPLE,
  if Explicit Scene Object Names is enabled, a typical generated command would be:
      move $Sphere03 [55.6739,23.5,0]
  If Selection-Relative Scene Object Names is enabled, a typical generated command would be:
      move $ [0,-47.8044,0]

  By using Selection-Relative Scene Object Names, you can apply the recorded script to a different selection, thereby making it somewhat general.

  Use Explicit Scene Object Names if you want the script to always work on the same objects regardless of the current scene selection.

  PERFORMANCE NOTE:
  In releases prior to 3ds Max 2009, selecting many nodes with Macro Recorder enabled resulted in a significant slowdown. This slowdown has been removed in 3ds Max 2009 and higher- selection times for 10000 objects with and without Macro Recorder are now practically identical.

Absolute Transform Assignments/Relative Transform Operations

  Specifies whether to use absolute or relative transform commands in the generated commands.

  FOR EXAMPLE,
  if Absolute Transform Assignments is enabled, a typical generated command when you move a selection in a viewport would be:
      $.position = [55.6739,23.5,0]
  If Relative Transform Operations is enabled, a typical generated command would be:
      move $ [0,-47.8044,0]

  When the Absolute Transform Assignments option is selected, absolute transform assignments are output only if a single object is transformed.

  If multiple objects are selected, relative transform operations are output.

Explicit Sub-object Sets/Selection-Relative Sub-object Sets

  Specifies whether to use explicit sub-object identifiers or the sub-object selection set property in the generated commands.

  FOR EXAMPLE,
  if Explicit Sub-object Sets is enabled, a typical generated command would be:
      move $Sphere02.verts[#{20..32, 51..65}] [40.0986,10.3648,0]
  If Selection-Relative Sub-object Sets is enabled, a typical generated command would be:
      move $Sphere02.selectedVerts [40.0986,10.3648,0]

  By using Selection-Relative Sub-object Sets, you can apply the recorded script to a different selection, thereby making it somewhat general. Use Explicit Sub-object Sets if you want the script to always work on the same sub-objects regardless of the current sub-object selection.

Command Panel Switching

  When Command Panel Switching is selected, the Macro Recorder will generate MAXScript commands for command panel switches.

  In most cases, recording command panel switches is superfluous as most scripts are not dependent on the user interface mode to work.

Tool Selections

  When Tool Selections is selected, the Macro Recorder will generate MAXScript commands for the selection of tools in the 3ds Max toolbar.

  In most cases, recording the selection of tools is superfluous as most scripts are not dependent on the tool selection to work.

Menu Item Selections

  When Menu Item Selections is selected, the Macro Recorder will generate MAXScript commands for the selection of menu items from the 3ds Max menu bar.

## Macro Recorder and Scripted Rollouts

When a scripted rollout performs parameter block value changes from its event handlers, the Macro Recorder is disabled automatically.

A special MAXScript context was introduced in 3ds Max 2013 to re-enable the Macro Recorder output explicitly in scripted rollouts' event handlers.

#### See Also

- MacroScripts for New Users
- Customizing MacroScript Buttons
- Defining Macro Scripts
- Creating Icon Bitmap Files