Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
3ds Max 6 Bible (2004).pdf
Скачиваний:
55
Добавлен:
17.08.2013
Размер:
50.02 Mб
Скачать

Chapter 48 Automating with MAXScript 1151

10.Open the Utilities panel, and click the MAXScript button. Then click the Run Script button, and select the BuildCube.ms file from the Chap 48 directory on the CD-ROM.

The utility installs and appears in the Utility drop-down list in the MAXScript rollout.

11.Select the BuildCube utility from the drop-down list in the MAXScript rollout, and scroll down the Command Panel to see the Build Cube rollout. Select the sphere object, and click the Create Cube button.

The script executes, and a cube of spheres is created.

Figure 48-18 shows the results of the BuildCube.ms script. You can use this script with any selected object.

Figure 48-18: The results of the BuildCube.ms script

Summary

This chapter gave you a brief introduction to MAXScript, 3ds max’s powerful, built-in scripting language. Besides describing the different types of scripts you can create, the chapter covered the following topics:

The basics of MAXScript

Using the MAXScript tools such as the MAXScript editor and Listener windows

Using the Macro Recorder to create scripts

1152 Part XII MAXScript and Plug-Ins

The different script types

The basics of writing your own scripts

The Visual MAXScript Editor interface

The features of each rollout element

How to create scripted utilities with custom rollouts

Now that you’re feeling more comfortable with scripts, we look at the pinnacle of added functionality — plug-ins.

 

 

 

Expanding Max with Third-Party Plug-Ins

Aplug-in is an external program that integrates seamlessly with the Max interface to provide additional functionality. Discreet

has adopted an architecture for Max that is open and enables all aspects of the program to be enhanced. Max ships with a Software Developer’s Kit (SDK) that enables users to generate their own plugins. Many companies currently produce plug-ins, and other users create and distribute freeware and shareware plug-ins.

Covering all the available plug-ins would be difficult, so this chapter covers a random sampling to give you an idea of the types of plug-ins that are available and their capabilities.

The entire architecture of Max is built around plug-ins, and many of the core components of Max are implemented as plug-ins. Max ships with a robust Software Developer Kit (SDK) that includes all the information you need to create your own plug-ins.

A key feature that allowed Max to become and remain so popular is that users can download and install plug-ins that extend Max’s power and functionality. Plug-ins allow Max to adapt to the needs of each user as well as keep up with new ideas.

Working with Plug-Ins

After you’ve located a plug-in that you would like to add to your system, you need to install the plug-in. Most commercial plug-ins come with an executable setup program that automates this for you, but others need to be installed manually, which isn’t difficult.

Note Plug-ins typically won’t work from one version of Max to another. If the plug-in is commercial, then the developers usually release an updated version of the plug-in for the new Max version.

As you begin to add plug-ins to Max, you may eventually want to see which plug-ins are installed and even disable certain plug-ins. Max includes tools to view installed plug-ins and to manage your current plug-ins.

49C H A P T E R

In This Chapter

Understanding plug-ins

Locating plug-ins

Installing, viewing, and managing plug-ins

Looking at plug-in examples

1154 Part XII MAXScript and Plug-Ins

Installing plug-ins

For commercial plug-ins that include an installation program, the installation process asks where the Max root directory is located. From this root directory, the plug-in program files are installed in the “plugins” directory, help files are installed in the “help” directory, and example scenes are installed in the “scenes” directory.

Plug-in program files typically have a .DLC, .DLR, .DLO, .DLU, .DLV, or .DLM extension, depending on the type of plug-in. When Max loads, it searches the plugins directory for these files and loads them along with the program files. You can manually install freeware plug-ins simply by copying the plug-in file into the plugins directory and restarting Max.

You can also place plug-ins in a different directory and load them from this directory. The Path Configuration dialog box is where you can specify additional plug-in paths.

Cross-

Find out more about the Path Configuration dialog box in Chapter 4, “Customizing the Max

Reference

Interface and Setting Preferences.”

 

Most commercial plug-ins require that the plug-in be authorized after installation. You must do this before you can use the plug-in, and you can usually do it via telephone, fax, or e-mail.

To remove a plug-in, use the uninstall feature that is part of the setup process, or delete the associated program files from the plugins directory.

Plug-ins can also create a help file that explains how to work with the plug-in. These help files are installed in the /help directory where Max is installed. To view these help files, open the Additional Help dialog box by choosing Help Additional Help.

Viewing installed plug-ins

To see all the currently installed plug-ins, choose File Summary Info to open the Summary Info dialog box and click the Plug-In Info button. This opens the Plug-In Info dialog box that lists all installed plug-ins with their details, as shown in Figure 49-1. As you can see, many plug-ins created by Discreet are installed with just the default installation.

Note

Even if you haven’t installed any plug-ins, this dialog box lists many plug-ins. These are core

 

functions in Max that are implemented as plug-ins.

Managing plug-ins

You can manage which installed plug-ins are available using the Plug-in Manager dialog box, shown in Figure 49-2. Open this dialog box by choosing Customize Plug-in Manager.

Each column in the Plug-in Manager dialog box includes information about the plug-ins. The columns include Tag, Name, Description, Status, Size, and Full Path. You can sort the list of plug-ins alphabetically by column if you click on the column name.

Each unique directory that is specified within the Configure Paths dialog box appears in the bottom pane of the Plug-in Manager. Use the check boxes to remove all plug-ins from that directory from the list.

Chapter 49 Expanding Max with Third-Party Plug-Ins 1155

Figure 49-1: The Plug-In Info dialog box includes a list of all the currently loaded plug-ins, both internal and external.

Figure 49-2: Use the Plug-in Manager dialog box to disable plug-ins.

In the list of plug-ins, you select a specific plug-in by clicking it. You can select multiple plugins in the list using the Ctrl and Shift keys. A right-click pop-up menu of options lets you control the selected plug-ins. You can also tag (or mark) certain plug-ins using the Tag Selected option in the right-click pop-up menu. For tagged plug-ins, a white check mark appears in the left column.

You can also choose to load or defer selected or checked plug-ins using the right-click pop-up menu. Plug-ins with a status of loaded are currently loaded in memory and available; these plug-ins are identified with a green circle in the Status column. The deferred plug-ins are waiting in the wings and load when needed; these plug-ins are identified with a yellow circle in the Status column. Plug-ins that are marked Unloaded (with a red circle) are not in memory.

1156 Part XII MAXScript and Plug-Ins

Using the right-click pop-up menu, you can also select Load New Plug-in, which opens the Choose Plug-in File dialog box where you can select a plug-in file. The file is then accessed from this directory and loaded into the Plug-in Manager list.

Many types of plug-ins are used to add many different kinds of features. This section includes some tutorials that show some of the available plug-in capabilities.

Tutorial: Installing and using the AfterBurn Plug-in Demo

If you’d like to try out some plug-ins before purchasing them, pull out the Partners CD that comes with Max or visit the developers’ Web sites to download a demo copy of the plug-in.

Caution

These demos are full-featured, but most of them are save-disabled, which prevents you from

 

saving the file that includes the plug-in’s features. Look at the readme file as the plug-in is

 

installed to see what has been disabled.

To install a demo plug-in from the Partners CD, follow these steps:

1.Insert the Partners CD-ROM into your CD-ROM drive. A menu of options appears. Click the Discreet Certified Plug-Ins link. A page of certified plug-in demos appears, including AfterBurn, Absolute Character Tools, DreamScape, and others.

2.Click AfterBurn to select it and click the Install button. This launches the installation wizard. Follow the Installation Wizard’s instructions and press Next to complete each step. Click the Finish button when the installation is complete.

3.You need to restart Max before the plug-ins features become available. Select Start Program Files Discreet 3ds max 6 to restart Max.

4.You can learn to use the AfterBurn plug-in using the help files that were installed. Select Help Additional Help and double-click the AfterBurn 3 reference in the list that opens. This opens the Help files for the plug-in.

5.After reviewing the help files, select Create Helpers Atmospherics Sphere Gizmo and drag in the Top viewport to create a gizmo.

6.Most of the AfterBurn plug-in features are found in the Environment & Effects dialog box. Select Rendering Environment (keyboard shortcut, 8) and click the Add button in the Atmosphere rollout. In the Add Atmospheric Effect list, double-click on the AfterBurn Combustion Demo effect. This adds the AfterBurn Combustion effect along with the AfterBurn Renderer to the Effects list and makes several new rollouts appear.

7.In AfterBurn Combustion Parameters rollout, click the Pick Gizmos button and select the Sphere Gizmo icon in the Top viewport.

8.Select Rendering Render (F10) to open the Render Scene dialog box. Make sure the Atmospherics option is enabled and render the Perspective viewport to see the resulting AfterBurn flame effect.

Figure 49-3 shows the resulting fireball created using the AfterBurn demo plug-in.