Using the Object Painter Script to Add Trees



Your Ad Here


The Object Paint utility is a script that allows you to select an object and then wherever you move your cursor, it paints the object. The objects are all placed on the world space grid, or whatever grid is active.

Create an object painter toolbar:

  1. Using Windows Explorer or My Computer, copy macro_objectpaint.mcr from the \tutorials\level_design directory into the \ui\macroscripts directory.

    Macro_ObjectPaint is a script that is one of many samples that ship with the software. They are available if you choose to install them by selecting Samples.

    All of these scripts can either be run by a keyboard shortcut, a menu or a quad menu. They do not appear in the interface until you customize your UI to display them. When they are run, all the scripts in the MAXScript Utilities folder appear in a category called MAXScript Utilities.

  2. On the Utilities panel, click MAXScript > Run Script.

  3. Navigate to the ui\macroscripts directory and run macro_objectpaint.mcr.

  4. From the Customize menu, choose Customize User Interface.

  5. In the Customize User Interface dialog, click the Toolbars tab.

  6. Click New to create a new toolbar, and name it Object Paint Tools.

    The new toolbar appears as a small box in the viewport.

  7. In the Category drop-down list, choose MAX Script Utilities.

    You should now see the Object Painter available from the Action table.

  8. Drag Object Painter from the list to the Object Paint Tools toolbar.

    Tip: If the Object Painter text does not display correctly on the toolbar, then go to Customize > Preferences. In the UI Display group of the General tab, turn off Fixed Width Text Buttons. Now the Object Painter button text displays correctly on the floating toolbar.

  9. Close the Customize User Interface dialog.

Use XRef object to add a tree:

  1. On the File menu, choose XRef Objects.

  2. In the XRef Objects dialog, click Add.

  3. Select city_tree1.max. If necessary, navigate to the \tutorials\level_design directory to locate the object.

  4. In the XRef Merge dialog, click Trunk02, and close the dialog.

    The tree appears in the scene.

  5. Right-click in the Top viewport to activate it without changing the selection. The tree is still selected. Make sure the Top viewport display is wireframe.

  6. Click Object Painter in the floating dialog.

  7. Set the Spacing to 30, and click the Paint button.

  8. Move your cursor from the right to the left in the top viewport, to paint a row of trees along the street.

  9. Save your work as mycitywithtrees.max.

    Tip: Object Painter doesn't work with grouped objects. If you want to paint a group, open up the group, then use Attach List to attach the objects together.

Summary

In this tutorial you have modeled a city block to be used as a game level. You have explored modeling with primitives and modifiers, and have used XRefs to add streetlights. You have used a Blend material to create a decal on the garage. And you've used the VertexPaint modifier to paint shadows and tint the road. Finally you've used a script to paint trees into your scene.


Comments

Return to Autodesk Index


Your Ad Here