Page 1208 - Kitab3DsMax
P. 1208
Part XII: MAXScript and Plug-Ins
In fact, you have already used MAXScript without even knowing it. Some of the buttons and rollouts use
bits of MAXScript to carry out your commands. And after you’ve created a new feature with MAXScript,
you can integrate it into Max transparently and use it just as easily as any other Max feature.
MAXScript is a fully functional and very powerful computer language, but you don’t have to be a computer
programmer or even have any previous programming experience to benefit from MAXScript. In the next few
sections, you’ll look at some simple ways to use MAXScript. For now, just think of a script in Max as you
would a script in a movie or play—it tells what’s going to happen, who’s going to do what, and when it’s going
to happen. With your scene acting as the stage, a script directs Max to put on a performance for you.
One final note before you dive in: MAXScript is so powerful that an entire book could be written about it
and every last feature it supports, but that is not the purpose here. This chapter is organized to give you an
introduction to the world of MAXScript and to teach you the basic skills you need to get some mileage out
of it. What is given here is a foundation that you can build upon according to your own interests and needs.
MAXScript Tools
MAXScript is pervasive and can be found in many different places. This section looks at the MAXScript
tools and how different scripts are created and used.
Let’s look at some of the tools used in working with MAXScript. Max has several tools that make creating
and using scripts as simple as possible.
The MAXScript menu
The MAXScript menu includes commands that you can use to create a new script, open and run scripts,
open the MAXScript Listener window (keyboard shortcut, F11) or the MAXScript Editor window, enable
the Macro Recorder, open the Visual MAXScript Editor, or access the Debugger dialog box.
The New Script command opens a MAXScript Editor window, a text editor in which you write your
MAXScript. See the “MAXScript Editor windows” section later in this chapter for more on this editor win-
dow. The Open Script command opens a file dialog box that you can use to locate a MAXScript file. When
opened, the script file is opened in a MAXScript Editor window, as shown in Figure 49.1. MAXScript files
have an .ms or .mrc extension. The Run Script command also opens a file dialog box where you can select
a script to be executed.
Note
When you use Run Script, some scripts do something right away, whereas others install themselves as new tools. n
The MAXScript Listener command opens the MAXScript Listener window. You also can open this window
by pressing the F11 keyboard shortcut. The Macro Recorder command starts recording a MAXScript macro.
The MAXScript Listener and recording macros are covered later in this chapter.
The MAXScript Utility rollout
You access the MAXScript Utility rollout, shown in Figure 49.2, by opening the Utilities panel in the
Command Panel and clicking the MAXScript button. This opens a rollout where you can do many of the
same commands as the MAXScript menu.
The MAXScript rollout also includes a Utilities drop-down list, which holds any installed scripted utilities.
Each scripted utility acts as a new feature for you to use. The parameters for these utilities are displayed in a
new rollout that appears below the MAXScript rollout.
1160