Your mother-in-law
Max Script lets Max users extend existing features add custom functionality to the modeling and animation environment.

Once a section of code has been debugged, it is added to the script and saved to disk. This script will usually need to define a GUI interface, especially if the user needs to enter options (such as the file name to save to). Defining an interface is easier in Max than in any other language or tool I have used. Alternatively, if no interface is required, the script could just be a sequence of commands that execute when the script is run. An example would be a script that rotated all of the objects in a scene 90 degrees. Such a script could be linked to a custom button inside the Max GUI for easy access.

Once a script is created with a GUI, it can be loaded into Max through the Utility panel. Clicking the Run Script button prompts the user to specify the MaxScript file to load. When your utility is loaded, its GUI is added to the Utility panel and it looks and acts as if it were a part of Max’s base code. If an error occurs during either the load and parse or the execution of a script, Max pops up the script source in an editor window and highlights the line on which the error occurred.

Fixing an error in a script can be frustrating, because it usually involves going back to the Listener, and typing your algorithm in line by line waiting to see the error. Only rarely was I able to debug the code by looking at the runtime error information supplied by Max. However, I did notice that as my familiarity with scripting increased, the time required for debugging decreased substantially, and I am now quite comfortable with the process.



Writing a File Exporter