Using the Object Painter Script to Add Trees
 
 
 

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 3ds Max \ui\macroscripts directory.

    Macro_ObjectPaint is a script that is one of many sample scripts that ship with 3ds Max. They are available if you choose to install them by selecting Samples.

    All of these scripts can be run either 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.

    TipIf 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 Create XRef Record From File.
  3. In the file selector, select city_tree1.max. If necessary, navigate to the \tutorials\level_design directory to locate this scene.
  4. In the XRef Merge dialog, click to highlight Trunk02, and then click OK.

    The tree appears in the scene.

    NoteIf a dialog appears warning that there is a duplicate material name, click Use Scene Material.
  5. Close the XRef Objects dialog.
  6. Right-click the Top viewport to activate it without changing the selection. The tree is still selected. Make sure the Top viewport display is wireframe.
  7. Click Object Painter in the new toolbar you created.
  8. Set the Spacing to 30.0, and click the Paint button.
  9. Drag your cursor from the right to the left in the top viewport, to paint a row of trees along the street.
  10. Save your work as mycitywithtrees.max.

    TipObject 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.