3ds Max Basic Tutorial
From Blue Mars Developer Guidebook
- The fact that 3ds Max can do almost everything also means it takes some time to learn how to use it. It is popular, so there are lots of books, tutorials, etc available for it. If you don't know already know how to use it, you should consider time to learn how among other factors in your choice of 3D software.
- The built in help files are very well written, though it helps to know what Max calls things to search for them in help. So if you are starting from scratch, find some tutorials online to get the basic terminology. In Max, use Help Menu > Autodesk 3ds Max Help to access the Help window.
The built-in Autodesk COLLADA exporter works for some types of objects and not others. To supplement it, a couple of other export plugins should be added after installing the program itself. Which one works best depends on the situation.
- After installing 3dsMax, get the CryEngine2 3ds Max Plugin, then put the appropriate version in the 3ds max\plugins folder. The versions are numbered to match those of the 3ds Max software. You can right click the 3dsmax.exe program, choose properties, and then details to find your version number if you don't know it. This plugin adds an export option to the main toolbar in 3ds Max, and adds the Crytek shader as an option in the Material Editor window.
- Also get the latest 1.2.5 OpenCOLLADA Installer or 1.3.0 Beta OpenCOLLADA Installerfor your operating system and install it. This plugin adds OpenCollada to the "Save as" window.
The following notes are based on 3ds Max 2010 SP1, with the above plugins installed, so if you use a different version it might be slightly different steps. To start with, you want to customize your setup of Max:
- Customize Menu > Show UI > Show Command Panel This shows the main Command Panel if it gets turned off. Most windows in Max can be dragged by their title bar, even outside the main program window. So once the command panel is open, drag it to where it is comfortable for you, and resize it to whatever shape you prefer.
- Vewports are the sub-windows that show one view each of your model. Normally 4 are displayed. Click the [+] Button in any viewport and
- > Show Grids To see the home grid. This is centered on the 0,0,0 point, which is where the pivot point for your model should be located when you export it.
- > Configure To set up your viewport layout and statistics display settings. Layout is a personal preference on your part, and can be changed any time.
- > Show Statistics Polygon, triangle, and vertex counts are limited for Blue Mars items, and should be optimized in any case to save data and improve performance, so you should be aware of your scene statistics.
- Customize Menu > Units Setup > Display Unit Scale = Metric/Centimeters The default unit for Blue Mars items is centimeters, while the default unit for city terrain is meters. Use centimeters in 3ds Max so that items will end up the correct scale in Blue Mars. Generally objects should be made and imported in the correct scale you want them to be. If there are limits on object size for import, they are pretty loose (100 meters or larger). Objects larger than 64 meters may lose precision in collision with other items.
Creating Basic Objects
This section lists the basic steps to make a box. There are numerous ways in 3ds Max to create and modify objects, and some of the steps below you will need to refer to tutorials or help menu for that command or menu item to get a full understanding of how they work.
- Click Command Panel > Create Tab (1st tab) > Geometry (1st button) choose Standard Primitives then Box. Click-drag in viewport to start box, release and drag vertically for height, click second time to finish item.
- Then you can enter precise dimensions and number of segments under Parameters in the Command Panel.
- Use Main Toolbar > Select and Move, then enter 0cm in the numeric entry boxes for X, Y, and Z to position the object at the origin point.
- Right click on the box in any viewport and choose Quad Menu > Convert To > Convert to Editable Poly. An Editable Poly is made up of vertexes and triangles of the type that can be exported to Blue Mars. All finished objects need to be editable polygons when exported. They can be other types of objects while you are working on them.
- Click Rendering Menu > Material Editor and select an open sample slot (one of the balls or boxes near the top). Then just above Shader Basic Parameters, click the Material Type button and choose Multi/Sub-Object instead of the default "Standard". Under Basic Parameters click Set Number to the number of sub-materials you need for your items. Blue Mars maximum is 32, but less than 10 is recommended for graphics performance. Blue Mars uses one .mtl material file per 3D model, so you have to put all your submaterials under one heading for it to export properly.
- Set each Submaterial to Crytek Shader, and under Maps > Diffuse Color assign a bitmap texture if you want to see how it will look while working on it. Give each submaterial a name that makes sense so you can match it later in the Blue Mars editors. Don't worry about other settings, since they do not export properly, and 3ds Max does not use the same graphics engine, so they will not look the same. You can adjust all the detailed material settings later in the Material Editor window of the Blue Mars editors, which do use the same engine as the actual user software.
- When done setting up the Material, choose Edit > Select All and then Material Editor > Material > Assign to Selection to apply the material to everything in the scene.
- Use Command Panel > Modify Tab > Modifier List:Material to assign submaterial ID numbers to whole objects or selected faces. You can also select the object in a viewport, go to the Modify (2nd) tab in the Command Panel, and then click the Polygon level (red square) under the selection heading. After selecting one or more polygon faces of the object, you can then use the Polgon: Material IDs heading to set the ID number. If you want adjacent polygons to appear smooth, use the next Polygon: Smoothing Groups to assign a group to a selected set of faces. Smoothing varies the lighting angle gradually across a polygon face, rather than keeping it constant for the face. If you want the object to appear to have hard edged faces, then leave smoothing off.
- Use Command Panel > Modify Tab > Modifier List > UVW Map to assign basic mapping of texture to object surface. You can use Unwrap UVW for a more detailed mapping. The default mapping is to apply the texture once per polgon. For a box that works adequately, but for more complex objects you will generally want to set a custom map. Once you create a custom UV map, you can export it as a template and use that as a layer in Photoshop or a similar program to build your custom textures on top of.
- When done editing, right click in Modify tab modify stack, and choose Collapse All, then
Utilities Tab > Reset XForm, and 3ds Max Icon > Save As to save file the .max type file. 3ds Max keeps previous changes in a modifer stack, so you can undo things, or change a value in an earlier step. For exporting to Blue Mars, you want to remove all that history by "collapsing" the stack, and then resetting any scale or rotation transformations with the "rest XForm" command. If you don't do these steps, the exported model may refer to an earlier state. You may want to keep a copy of your file with the stack and transforms intact for later editing, and then do a Save As to a different file name and clean up the history in that copy only to get a clean export.
Importing to Blue Mars
This procedure assumes you are making an item to be used in the City or Block Editors:
- Use 3ds Max Icon > Export to open export window, and Save As Type = OpenCOLLADA (*.DAE). It will end up in My Documents\3dsMax\export. Some of the Blue Mars software has trouble with spaces in the file path, so use an _underscore_ rather than space in file and folder names, or just SqueezeTheWordsTogether.
- Make a new folder under C:\Program Files\Blue Mars Developer Tools\Game\Objects\MyData\ and copy the .dae into it. The file structure under MyData is up to you, but generally one folder per model is best.
- Place your .dds or .tif format texture maps in the same folder. If you already used the same files in 3ds Max to see how things looked, it should recognize them, if not, you will need to use the Material Editor window later to point to them.
- Start the Item Editor, and use File > Open, select .dae as the file type, and navigate to your new folder. Click OK, then when the
converter window opens, click convert, then load. A DOS window will scroll past usually too fast to read, and a native Blue Mars .cgf model and .mtl material file will be created.
- Assuming your model was located at the 0.0.0 point, it should now appear on top of the 1 meter cube in the scene. You can use the right mouse button + move mouse to orbit the view, scroll wheel to zoom, and arrow keys to pan sideways.
- Use View > Open View Pane > Material Editor to open the Material Editor Window. The left side is a browser, so use that to find your object. There is one more level below the object for each sub-material. Click each one and then in the simplest case, just put your basic texture map location into the Diffuse slot under Texture Maps for each sub material. See the Material Editor tutorial for more details.
- When you have got all your textures assigned, use Items > Pack Folder for Upload. The screen will go bonkers for a few seconds and it will create a zip file in the same folder with all the parts of your item (.cgf, .mtl, and .dds). The files needed to be all in the same folder for that to work right.
- You can now use Items > Check Item in Blue Mars and log into your Blue Mars account to a test level, and see how it looks in the actual Blue Mars software rather than an editor. If it all looks good, you can now log out, and close the item editor.
- The .cgf model, .mtl material settings, and .dds texture files will be copied to the appropriate city or block directory to use. The material settings will need to be adjusted to point to the new location of the texture maps. Advanced users may skip the material setup in the item editor, and just do that in the final City or Block editor.