MaxScript

3DS Max has a scripting language that can be used to procedurally generate models as well as create ui elements within Max. This chapter will look at maxscript.

Accessing MaxScript

Tools related to MaxScript can be accessed through the MaxScript menu item.

For creating your code, you can use the maxscript editor but you can also just use any editor of your choice. It makes no difference how you create your file, at the end of the day its just code in a script file.

Editor

To start up the maxscript editor, you can select it from the maxscript menu. The editor does have some basic syntax highlighting so it could be useful. Alternatively you can use your favorite non-max related editor if you wish. anything that edits text without adding in junk characters work. For sublime text, there are plugins available for maxscript syntax highlighting. There also appears to be similar plugins for notepad++.

Listener and Macro Recorder

The listener is like a maxscript shell. You can write maxscript commands in the listener and it will execute. It is not recommended for complex scripts but really good for simple experimentation.

The listener window also houses the macro recorder window. This is the pink area at the top.

You can make it bigger by dragging the separator.

Note: Depending on the setup it is entirely possible that the separator in the listener window is at the top and there is no pink portion visible at all. Simply drag it down to reveal this area

The macro recorder will record what happens in the view port. So for example, if you draw a box object in your scene, it will record the macro to do so with all the parameters. The macro recorder is really useful to help you find things like parameter names and types.

The macro recorder can be enabled in both the maxscript menu in the max application window as well as the MacroRecorder menu item inside the listener window.