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 49.17, select it from the MAXScript menu. Another way to access this window is to select Edit image from book New Rollout or Edit Rollout (F2) in the MAXScript Editor window.

image from book
Figure 49.17: 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.

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 layouts to a file (Ctrl+S), 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 image from book 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 49.2.

Table 49.2: Visual MAXScript Form Elements
Open table as spreadsheet

Button

Element

What It Does

image from book

Bitmap

Lets you add bitmap images to a rollout

image from book

Button

Adds a simple button

image from book

Map Button

Adds a mapping button that opens the Material/Map Browser

image from book

Material Button

Adds a material button that also opens the Material/Map Browser

image from book

Pick Button

Adds a button that lets you pick an object in a viewport

image from book

Check Button

Adds a button that can be toggled on and off

image from book

Color Picker

Adds a color swatch that opens the Color Picker dialog box when clicked

image from book

Combo Box

Adds a list with several items

image from book

Drop Down List

Adds a list with one item displayed

image from book

List Box

Adds a list with several items displayed

image from book

Edit Box

Adds a text field that can be modified

image from book

Label

Adds a text label

image from book

Group Box

Adds a grouping outline to surround several controls

image from book

Check Box

Adds a check box control that can be toggled on or off

image from book

Radio Buttons

Adds a set of buttons where only one can be selected

image from book

Spinner

Adds an up and down set of arrows that can modify a value field

image from book

Progress Bar

Adds a bar that highlights from left to right as a function is completed

image from book

Slider

Adds a slider control that can move from a minimum to a maximum value

image from book

Timer

Adds a timer that counts time intervals

image from book

ActiveX Control

Adds a generic ActiveX control created by a separate vendor

image from book

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.




3ds Max 9 Bible
3ds Max 9 Bible
ISBN: 0470100893
EAN: 2147483647
Year: 2007
Pages: 383

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net