SMD Collisionmodel Prep 3DS Max Tool Version 1.1

Last Updated on May 1, 2013

Important Note (added on 2011-02-09):

While this tool is useful, it has now been integrated into the Wall Worm Model Tools--a powerful new UI for setting up your Source Model inside 3ds Max. Any further updates to the SMD Collisionmodel Prep tool will be inside the Wall Worm Model Tools.

Instead of using this tool, you should first look at the Wall Worm Model Tools!

Wall Worm Model Tools for 3ds Max and Source

SMD Collisionmodel Prep features

The whole purpose of this tool is to speed the process of making a collision model that will be exported as an SMD file and sent to the Valve model compile tools. This is a Macro written in MaxScript for 3D Studio Max. Below is a current list of features of this tool.

Below are the features of the SMD Collisionmodel Prep tool (not the Wall Worm Model Tools listed above)

Smoothing Groups
To properly compile a MDL file from your SMD, your model must have unique smoothing groups for each element in your model. This tool automatically applies unique smoothing groups to each element of your model.
Texture Application
To compile, your collision model must have a texture applied to it with a bitmap in the diffuse channel--even though a collision model is never rendered on a screen and never uses a texture. This tool automatically applies a standard material and places a dummy texture in the diffuse channel--so now you dont' have to bother.
Add Player Box (Added in v1.1)
This button will add a 24x24x72 green box primitive to the center of the world. The purpose of this box is for a reference regarding the size of a player model in Source. After you are done building your model or map, you will probably want to delete the box. The name of the box is wwPlayerBox.

Installation

  1. Download the Zip File
  2. If you are on Windows Vista/Windows 7 you may need to right-click the zip file, choose properties and click the "Unblock" button. If you fail to do this, the images may be inaccessible/broken.
  3. Copy the Wallworm folder and all its contents from the zip file to your scripts folder. By default, this is something like C:\Program Files\Autodesk\3ds Max 2010\Scripts
  4. In 3DS, click MAXScript > Run Script... in the menu bar. Browse to the location you extracted the zip file to and open the file WWcollisionmeshPrep.ms inside the Wallworm folder.
  5. In 3DS, click Customize > Customize User Interface
  6. In the Customizer User Interface menu, select Quads and choose wallworm.com from the Categories list. Drag the "Prepare Collision Model..." action to the place on the quad menu (to the right) that you want the item to appear
  7. Close the customize menu
  8. Now whenever you right-click a viewport, you will see the SMD Collision Prep option.

Using the SMD Collision Prep

Assuming that you have made a way to access the tool (in the install example above it is by right-clicking and bringing up a quad menu), you can bring up the tool after you have made your collision model. The tool will ask you to select the collision mesh. Voila! Each element in the model will have its own smoothing group and a diffuse texture applied. You can now export to SMD*.

Notes

Relevant Resources

Credits

This tool was programmed by Shawn Olson and Andrew Penry. Neither of us are masters of MaxScript... but we did manage to use our skills with other languages to put together this tool one afternoon. If you like it, please link to us and/or leave feedback in our respective sites.

A segment of code to select elements was used from Martijn van Herk.