
- •Preface
- •About This Book
- •Acknowledgments
- •Contents at a Glance
- •Contents
- •Relaxing at the Beach
- •Dressing the Scene
- •Animating Motion
- •Rendering the Final Animation
- •Summary
- •The Interface Elements
- •Using the Menus
- •Using the Toolbars
- •Using the Viewports
- •Using the Command Panel
- •Using the Lower Interface Bar Controls
- •Interacting with the Interface
- •Getting Help
- •Summary
- •Understanding 3D Space
- •Using the Viewport Navigation Controls
- •Configuring the Viewports
- •Working with Viewport Backgrounds
- •Summary
- •Working with Max Scene Files
- •Setting File Preferences
- •Importing and Exporting
- •Referencing External Objects
- •Using the File Utilities
- •Accessing File Information
- •Summary
- •Customizing Modify and Utility Panel Buttons
- •Working with Custom Interfaces
- •Configuring Paths
- •Selecting System Units
- •Setting Preferences
- •Summary
- •Creating Primitive Objects
- •Exploring the Primitive Object Types
- •Summary
- •Selecting Objects
- •Setting Object Properties
- •Hiding and Freezing Objects
- •Using Layers
- •Summary
- •Cloning Objects
- •Understanding Cloning Options
- •Mirroring Objects
- •Cloning over Time
- •Spacing Cloned Objects
- •Creating Arrays of Objects
- •Summary
- •Working with Groups
- •Building Assemblies
- •Building Links between Objects
- •Displaying Links and Hierarchies
- •Working with Linked Objects
- •Summary
- •Using the Schematic View Window
- •Working with Hierarchies
- •Setting Schematic View Preferences
- •Using List Views
- •Summary
- •Working with the Transformation Tools
- •Using Pivot Points
- •Using the Align Commands
- •Using Grids
- •Using Snap Options
- •Summary
- •Exploring the Modifier Stack
- •Exploring Modifier Types
- •Summary
- •Exploring the Modeling Types
- •Working with Subobjects
- •Modeling Helpers
- •Summary
- •Drawing in 2D
- •Editing Splines
- •Using Spline Modifiers
- •Summary
- •Creating Editable Mesh and Poly Objects
- •Editing Mesh Objects
- •Editing Poly Objects
- •Using Mesh Editing Modifiers
- •Summary
- •Introducing Patch Grids
- •Editing Patches
- •Using Modifiers on Patch Objects
- •Summary
- •Creating NURBS Curves and Surfaces
- •Editing NURBS
- •Working with NURBS
- •Summary
- •Morphing Objects
- •Creating Conform Objects
- •Creating a ShapeMerge Object
- •Creating a Terrain Object
- •Using the Mesher Object
- •Working with BlobMesh Objects
- •Creating a Scatter Object
- •Creating Connect Objects
- •Modeling with Boolean Objects
- •Creating a Loft Object
- •Summary
- •Understanding the Various Particle Systems
- •Creating a Particle System
- •Using the Spray and Snow Particle Systems
- •Using the Super Spray Particle System
- •Using the Blizzard Particle System
- •Using the PArray Particle System
- •Using the PCloud Particle System
- •Using Particle System Maps
- •Controlling Particles with Particle Flow
- •Summary
- •Understanding Material Properties
- •Working with the Material Editor
- •Using the Material/Map Browser
- •Using the Material/Map Navigator
- •Summary
- •Using the Standard Material
- •Using Shading Types
- •Accessing Other Parameters
- •Using External Tools
- •Summary
- •Using Compound Materials
- •Using Raytrace Materials
- •Using the Matte/Shadow Material
- •Using the DirectX 9 Shader
- •Applying Multiple Materials
- •Material Modifiers
- •Summary
- •Understanding Maps
- •Understanding Material Map Types
- •Using the Maps Rollout
- •Using the Map Path Utility
- •Using Map Instances
- •Summary
- •Mapping Modifiers
- •Using the Unwrap UVW modifier
- •Summary
- •Working with Cameras
- •Setting Camera Parameters
- •Summary
- •Using the Camera Tracker Utility
- •Summary
- •Using Multi-Pass Cameras
- •Creating Multi-Pass Camera Effects
- •Summary
- •Understanding the Basics of Lighting
- •Getting to Know the Light Types
- •Creating and Positioning Light Objects
- •Viewing a Scene from a Light
- •Altering Light Parameters
- •Working with Photometric Lights
- •Using the Sunlight and Daylight Systems
- •Using Volume Lights
- •Summary
- •Selecting Advanced Lighting
- •Using Local Advanced Lighting Settings
- •Tutorial: Excluding objects from light tracing
- •Summary
- •Understanding Radiosity
- •Using Local and Global Advanced Lighting Settings
- •Working with Advanced Lighting Materials
- •Using Lighting Analysis
- •Summary
- •Using the Time Controls
- •Working with Keys
- •Using the Track Bar
- •Viewing and Editing Key Values
- •Using the Motion Panel
- •Using Ghosting
- •Animating Objects
- •Working with Previews
- •Wiring Parameters
- •Animation Modifiers
- •Summary
- •Understanding Controller Types
- •Assigning Controllers
- •Setting Default Controllers
- •Examining the Various Controllers
- •Summary
- •Working with Expressions in Spinners
- •Understanding the Expression Controller Interface
- •Understanding Expression Elements
- •Using Expression Controllers
- •Summary
- •Learning the Track View Interface
- •Working with Keys
- •Editing Time
- •Editing Curves
- •Filtering Tracks
- •Working with Controllers
- •Synchronizing to a Sound Track
- •Summary
- •Understanding Your Character
- •Building Bodies
- •Summary
- •Building a Bones System
- •Using the Bone Tools
- •Using the Skin Modifier
- •Summary
- •Creating Characters
- •Working with Characters
- •Using Character Animation Techniques
- •Summary
- •Forward versus Inverse Kinematics
- •Creating an Inverse Kinematics System
- •Using the Various Inverse Kinematics Methods
- •Summary
- •Creating and Binding Space Warps
- •Understanding Space Warp Types
- •Combining Particle Systems with Space Warps
- •Summary
- •Understanding Dynamics
- •Using Dynamic Objects
- •Defining Dynamic Material Properties
- •Using Dynamic Space Warps
- •Using the Dynamics Utility
- •Using the Flex Modifier
- •Summary
- •Using reactor
- •Using reactor Collections
- •Creating reactor Objects
- •Calculating and Previewing a Simulation
- •Constraining Objects
- •reactor Troubleshooting
- •Summary
- •Understanding the Max Renderers
- •Previewing with ActiveShade
- •Render Parameters
- •Rendering Preferences
- •Creating VUE Files
- •Using the Rendered Frame Window
- •Using the RAM Player
- •Reviewing the Render Types
- •Using Command-Line Rendering
- •Creating Panoramic Images
- •Getting Printer Help
- •Creating an Environment
- •Summary
- •Creating Atmospheric Effects
- •Using the Fire Effect
- •Using the Fog Effect
- •Summary
- •Using Render Elements
- •Adding Render Effects
- •Creating Lens Effects
- •Using Other Render Effects
- •Summary
- •Using Raytrace Materials
- •Using a Raytrace Map
- •Enabling mental ray
- •Summary
- •Understanding Network Rendering
- •Network Requirements
- •Setting up a Network Rendering System
- •Starting the Network Rendering System
- •Configuring the Network Manager and Servers
- •Logging Errors
- •Using the Monitor
- •Setting up Batch Rendering
- •Summary
- •Compositing with Photoshop
- •Video Editing with Premiere
- •Video Compositing with After Effects
- •Introducing Combustion
- •Using Other Compositing Solutions
- •Summary
- •Completing Post-Production with the Video Post Interface
- •Working with Sequences
- •Adding and Editing Events
- •Working with Ranges
- •Working with Lens Effects Filters
- •Summary
- •What Is MAXScript?
- •MAXScript Tools
- •Setting MAXScript Preferences
- •Types of Scripts
- •Writing Your Own MAXScripts
- •Learning the Visual MAXScript Editor Interface
- •Laying Out a Rollout
- •Summary
- •Working with Plug-Ins
- •Locating Plug-Ins
- •Summary
- •Low-Res Modeling
- •Using Channels
- •Using Vertex Colors
- •Rendering to a Texture
- •Summary
- •Max and Architecture
- •Using AEC Objects
- •Using Architectural materials
- •Summary
- •Tutorial: Creating Icy Geometry with BlobMesh
- •Tutorial: Using Caustic Photons to Create a Disco Ball
- •Summary
- •mental ray Rendering System
- •Particle Flow
- •reactor 2.0
- •Schematic View
- •BlobMesh
- •Spline and Patch Features
- •Import and Export
- •Shell Modifier
- •Vertex Paint and Channel Info
- •Architectural Primitives and Materials
- •Minor Improvements
- •Choosing an Operating System
- •Hardware Requirements
- •Installing 3ds max 6
- •Authorizing the Software
- •Setting the Display Driver
- •Updating Max
- •Moving Max to Another Computer
- •Using Keyboard Shortcuts
- •Using the Hotkey Map
- •Main Interface Shortcuts
- •Dialog Box Shortcuts
- •Miscellaneous Shortcuts
- •System Requirements
- •Using the CDs with Windows
- •What’s on the CDs
- •Troubleshooting
- •Index

Chapter 48 Automating with MAXScript 1145
Learning the Visual MAXScript Editor Interface
Building scripts can be complicated, and piecing together a rollout for a scripted utility can be especially time-consuming and frustrating when done by hand. To help create such custom rollouts, Max includes the Visual MAXScript Editor. Using this editor, you can drag and drop rollout elements and automatically create a code skeleton for certain events.
Working with textual commands can be time-consuming. In order for the script to work, you need to enter the commands exactly. This can be especially tricky when you’re trying to lay out the controls for a rollout. Max includes a tool called the Visual MAXScript Editor that speeds up the creation of rollouts.
To access the Visual MAXScript window, shown in Figure 48-14, open the Utility panel in the Command Panel and click the More button. Then select the Visual MAXScript option from the list of utilities, and click OK. Another way to access this window is to select Edit New Rollout or Edit Rollout (F2) in the MAXScript editor window.
Figure 48-14: The Visual MAXScript window makes building rollouts easy.
Layouts for a rollout created in the Visual MAXScript window can be saved as files with the
.VMS extension using the File menu. If you access the window from a MAXScript editor window, then the Save menu automatically updates the editor window.
The Editor interface
The window includes two major panes. The left pane is where the various rollout elements are assembled, and the right pane holds the Value and Event Handlers tabbed panels. The Value panel lists all the properties and their associated values for the selected element. You can change the property values by clicking on them and entering a new value. For example, if you select a Button element in the left panel, then the properties for that control are presented in the Value panel. If you click the Caption Property, its value becomes highlighted; you can type a new caption, and the new caption appears on the button.

1146 Part XII MAXScript and Plug-Ins
The Event Handlers panel lists all the available events that can be associated with the selected element. Clicking the check box to the left of these events can enable the events. For a button element, you can enable the pressed event. With this event enabled, the code includes a function where you can define what happens when this event is fired.
The menus and the main toolbar
At the top of the interface are some menu options and a main toolbar. The File menu also lets you create a new layout (Ctrl+N), save (Ctrl+S) layouts to a file, and open saved layouts (Ctrl+O). The Edit menu allows you to cut (Ctrl+X), copy (Ctrl+C), and paste (Ctrl+V) form elements. You can find these same features as buttons on the top toolbar.
The Layout menu includes options for aligning elements left (Ctrl+left arrow), right (Ctrl+right arrow), top (Ctrl+up arrow), bottom (Ctrl+down arrow), vertical center (F9), and horizontal center (Shift+F9); to space elements evenly across (Alt+right arrow) or down (Alt+up arrow); make elements the same size by width, height, or both; center vertically (Ctrl+F9) or horizontally (Ctrl+Shift+F9) in the dialog box; and flip. You can use the Layout Guide Settings menu command to specify grid snapping and spacing. Grids are enabled using the Toggle Grid/Snap button on the right end of the main toolbar.
You can also access these commands using a right-click pop-up menu when clicking on the left pane.
Toolbar elements
The toolbar along the bottom of the window contains the form elements that you can drop on the form. These buttons and elements include those shown in Table 48-1.
Table 48-1: Visual MAXScript Form Elements
Button |
Element |
What It Does |
|
|
|
|
Bitmap |
Lets you add bitmap images to a rollout |
|
Button |
Adds a simple button |
|
Map Button |
Adds a mapping button that opens the Material/Map |
|
|
Browser |
|
Material Button |
Adds a material button that also opens the |
|
|
Material/Map Browser |
|
Pick Button |
Adds a button that lets you pick an object in a |
|
|
viewport |
|
Check Button |
Adds a button that can be toggled on and off |
|
Color Picker |
Adds a color swatch that opens the Color Picker |
|
|
dialog box when clicked |

Chapter 48 Automating with MAXScript 1147
Button |
Element |
What It Does |
|
|
|
|
Combo Box |
Adds a list with several items |
|
Drop Down List |
Adds a list with one item displayed |
|
List Box |
Adds a list with several items displayed |
|
Edit Box |
Adds a text field that can be modified |
|
Label |
Adds a text label |
|
Group Box |
Adds a grouping outline to surround several controls |
|
Check Box |
Adds a check box control that can be toggled |
|
|
on or off |
|
Radio Buttons |
Adds a set of buttons where only one can be |
|
|
selected |
|
Spinner |
Adds an up and down set of arrows that can modify |
|
|
a value field |
|
Progress Bar |
Adds a bar that highlights from left to right as a |
|
|
function is completed |
|
Slider |
Adds a slider control that can move from a minimum |
|
|
to a maximum value |
|
Timer |
Adds a timer that counts time intervals |
|
ActiveX Control |
Adds a generic ActiveX control created by a separate |
|
|
vendor |
|
Custom |
Adds a custom control that can be defined as |
|
|
needed |
|
|
|
At the bottom right of the window are two text fields that display the coordinates of the current mouse cursor position and the size of the rollout. The default size of the rollout is 162×300, which is the size needed to fit perfectly in the Command Panel.
Laying Out a Rollout
The rollout space, which appears gray in the left pane, can be selected and resized by dragging the black square handles at the edges of the form. As you change its size, its dimensions are displayed in the lower-right corner of the interface. With the rollout space correctly sized, you are ready to add elements to the space.

1148 Part XII MAXScript and Plug-Ins
To add one of these elements to the form, click the element button on the toolbar and drag on the form. The element appears and is selected. The selected element is easy to identify by the black handles that surround it. Dragging on these handles resizes the element, and clicking and dragging on the center of the element repositions it within the rollout space.
The Value and Events panels are automatically updated to show the values and events for the selected element. Values such as width and x-pos are automatically updated if you drag an element or drag its handles to resize it.
Aligning and spacing elements
Although only one element at a time can be surrounded by black handles, you can actually drag an outline in the rollout space to select multiple elements at once. With several elements selected, you can align them all to the left (Ctlr+left arrow), horizontally centered (Shift+F9), right (Ctrl+right arrow), top (Ctrl+up arrow), vertically centered (F9), or bottom (Ctrl+down arrow).
Multiple elements can also be spaced across (Alt+right arrow) or down (Alt+up arrow). To make several elements the same width, height or both, use the Layout Make Same Size menu command. The Center in Dialog menu aligns elements to the center of the dialog either vertically (Ctrl+F9) or horizontally (Ctrl+Shift+F9). The Flip command reverses the position of the selected elements.
Figure 48-15 shows a form with several aligned elements added to it.
Figure 48-15: You can add control elements to the form in the Visual MAXScript window.

Chapter 48 Automating with MAXScript 1149
Tutorial: Building a custom rollout with the Visual MAXScript Editor
Now you need some practice using this powerful tool. In this example, you use the Visual MAXScript window to lay out a rollout and code the script to make it work.
To create a custom rollout using the Visual MAXScript editor, follow these steps:
1.Open the BuildCube.max file from the Chap 48 directory on the CD-ROM. This file includes a simple sphere object.
2.Choose MAXScript New Script to open the MAXScript editor window. In the editor window, enter the following:
utility buildCube “Build Cube” ( )
This line creates a utility named buildCube. The rollout name will be Build Cube. Make sure to include a space in between the parentheses.
3.Choose Edit New Rollout from the window menu (or press the F2 key). The Visual MAXScript window opens. The properties for this rollout are displayed in the Properties panel. Drag the lower-right black square handle to resize the rollout form.
4.Click the spinner button on the bottom toolbar, and drag in the rollout form to create a spinner element. In the Properties panel, set the name to SideNum, set the caption value to No. of Side Objects, select the #integer for the type, and set the range to [1,100,5]. The range values set the lower, upper, and default values for the spinner. Then drag on the element handles to resize the element to fit in the form.
5.Click the spinner button again, and drag in the rollout form to create another spinner element. In the Properties panel, set the name to length, set the caption value to Side Length, select the #integer for the type, and set the range to [1,1000,50]. Then drag on the element handles to resize the element to fit in the form.
6.Click the button icon on the bottom toolbar, and drag in the rollout form to create a button below the spinners. In the Properties panel, set the name to createCube and the caption value to Create Cube. Then drag on the element handles to resize the button so the text fits on the button. Open the Event Handlers panel, and select the Pressed check box.
7.Drag over the top of both the spinners to select them both, and choose Layout Align Right (or press Ctrl+right arrow) to align the spinners. Figure 48-16 shows how the rollout layout looks.

1150 Part XII MAXScript and Plug-Ins
Figure 48-16: The rollout laid out in the Visual MAXScript window
8.With the layout complete, choose File Save (or press Ctrl+S) to save the layout, and then close the Visual MAXScript window.
The script code associated with the layout is automatically placed in the editor window.
9.Complete the script by entering the script commands immediately after the open parenthesis that appears on the line following the on createCube pressed do event, as shown in Figure 48-17. If you don’t have any original code that you want to enter, you can copy and paste the code from the BuildCube.ms file from the Chap 48 directory on the CD-ROM.
Figure 48-17: The MAXScript editor window is updated with the code from the Visual MAXScript window.