RPC Spray Script Tutorial
This tutorial will give you a step by step method for placing RPC’s (People and/or Trees) onto an uneven terrain using the RPC Spray maxscript utility within 3ds max , viz and Autodesk VIZ.
Step 1. Download the RPC_Spray.ms file and place in your Scripts directory in 3d studio. (3DS MAX3 and 3DS VIZ3 users may need to download the moustrak.dlx file and place in the /Plug-ins directory of 3d studio.)
Step 2. Create a simple terrain such as the one you see pictured here. In this example we modified points on the terrain using “soft selection” to create a gently flowing terrain.
Note: This MaxScript uses a special mouse tracking funtion that does not always work with nurbs surfaces. We would suggest creating a copy of your nurbs surface, converting that copy to a mesh and using the mesh as the spraying surface with the script.
Step 3. Place a single copy of each RPC file that you wish to propogate across the terrain to the right of the terrain geometry. The location of the RPC’s will not affect the Spray utility however if you are going to spray several different RPC files onto your terrain you should place them close together for easier selection.
Step 4. You now need to run the RPC Spray maxscript file by choosing the Utilities : MaxScript option in 3ds max or Autodesk VIZ. After choosing MaxScript you can choose the Run option and select the RPC Spray maxscript file that you downloaded. (Hint: Placing the RPC_Spray.ms file in the Scripts/Startup directory of 3d studio will automatically load the file each time 3d studio is started).
After running the RPC_Spray.ms file you should see “RPC Spray” in the Utilites pulldown menu just below the Run option as indicated in the image to the right. Choose the RPC Spray option in the pulldown menu to activate the script.
Step 5. You will now be prompted to select the Spray Surface and Spray Objects options. The Spray Surface is defined as the geometry on which you would like to spray your RPC content. In this case we will select our “terrain” geometry and then choose the “Use Selected” option to define this as our spraying surface.
The Spray Objects are defined as the RPC’s that you wish to propogate along your terrain. Make the RPC’s that we wish to spray upon the terrain the currently selected objects and choose “Use Selected” under the Spray Geometry section.
Step 6. You have 3 options which define the manner in which the RPC’s will be placed upon the terrain. Normalize will cause each RPC to be oriented in the direction of the surface normal of the polygon on which the RPC rests. When placing RPC Trees on a terrain you will probably not want to choose this option as your trees would not appear to grow “up” but rather pointing in strange directions.
The Random Rotate and Collision Detection options are very useful in placing trees. Random Rotate will randomly rotate the RPC’s as they are sprayed upon the surface giving a desired degree of variation and randomness. The Collision Detection option will automatically calculate the position of RPC’s in relation to one another as you spray them on the surface and will not allow 2 RPC’s to cross one another.
You also have the option of selecting objects to exclude from the spraying area. This can be helpful if you have a road or water as part of a terrain where you do not want the RPC files to be placed. To use this option select the objects which cover the area you wish to be excluded and select the “Use Selected” button under the Exclude on Surface rollout option.
Step 7. The final step is to choose the Spray button and then begin to move your mouse across the surface on which you wish to spray the RPC files while holding down the left mouse button. You have the option of stopping the application of RPC’s upon the spray surface at any time by releasing the left mouse button. Holding down the left mouse button again will continue the spraying operation.
Step 8. Enjoy the fruits of you labor! In just a few minutes you will have accomplished what would take hours if you had to manually place each RPC. Each RPC will be placed at the point where it will meet the surface on which you spray. This is a great tool for quickly populating forests and shrubs and grasses. Try it with RPC People too. You can fill a mall in a couple of minutes!
Need help? Please e-mail support@archvision.com.