Mesh/Exporting a mesh from 3ds Max

From Second Life Wiki
Jump to navigation Jump to search

Software Setup

Recent versions of 3ds Max have the Autodesk Collada Exporter included in the software. For older versions or as an alternative, you can get the OpenCollada plugin from the OpenCOLLADA Download Page or OpenCollada project page.

  • Note: Even using the latest version of 3ds Max (2011 at time to write this), you need update your Autodesk Collada Exporter if you want export your meshes properly without problems. The Autodesk Collada Exporter is included (and free to download) in the FBX Plug-ins. You can download the latest version from Autodesk FBX page. OpenCOLLADA can't export meshes for SL. The exported file lost the UV coordinates and can't be rigged, so use Autodesk Collada instead.

Basic workflow

Scale to meters

One meter in 3D Studio Max converts to one meter in Second Life. In order for your model to upload with the expected scale, you will need to change Max's units to metric since it isn't the default unit settings.


To Set Up the Correct Scale for Your 3D Studio Max Scene:

  1. From the top drop down menu, select "Customize" --> "Units Setup..."
  2. In the "Units Setup" dialog box that appears, select "Metric" in the "Display Unit Scale" field. (At Default, Max has the units set to "Generic Units")
  3. Under Metric you can choose between millimeters, centimeters, meters, and kilometers via a drop down menu.
    Which metric system you would like to use depends on what you're creating. So long as you’re working in metric units, any metric system you choose to work in will upload equally in Second Life. Choosing meters should ideally work for most mesh creations for Second Life. If you are working on very small meshes like jewelery, choosing centimeters may prove more helpful.
  4. Click on the button "System Unit Setup" in the "Units Setup" dialog box.
  5. In the "System Unit Setup" dialog box that appears, you'll probably see the following: "1 Unit = 1.0 Inches" as this is the default setting. Select the drop down menu for "Inches" and select a metric unit instead. For example: If you're using meters for the Display Unit Scale, select Centimeters to replace Inches here.

Create a box (or monkey or teapot or hippo)

Reduce polygons

Keeping Track of Your Triangle Count

3D Studio Max has a utility that can keep a count of how many triangles or polygons you have in a selected object. This will be useful during the process of either cutting down or bulking up your model’s topology for your High, Medium, Low, and Lowest LODs meshes.

Adding the Utility “Polygon Counter” to Max’s (vers.2010) Default List of Utilities:

  1. Go to the Command Panel and click on the “Utilities” (The Hammer) Tab.
  2. Click on “Config Button Sets” Button - it is the button to the right of the “Sets” Button
  3. In the “Config Button Sets” dialog box, there is a drop down menu for “Total Buttons”. 3D Studio Max 2010’s default list is set to 9 buttons. Bump the number up to ten. When you scroll down the right “Utilities” column, there will be a new blank button added to this list.
  4. Find the utility named “Polygon Counter” under Max Standard in the left “Utilities” column. Click and drag “Polygon Counter” to the new blank button you just added. Click OK or Save the list as a new utility set and this will add the Polygon Counter Utility to the commonly used list of utilities in the Utilities Tab.

The Polygon Counter utility counts either triangles or polygons in a selected object(s) and it also gives a tally for all geometry in the scene. For the purposes of creating for Second Life, you will want to keep the count type set as “Count Triangles”. The Budget fields are values you can set yourself. It represents the maximum number of triangles/polygons you’ve allotted yourself for a model or a scene of models. Setting a Triangle/Polygon Budget will not affect your model if you go over budget.

UV texture Mapping

Part 1 http://www.youtube.com/watch?v=vUUhOCEujUI Part 2 http://www.youtube.com/watch?v=AApNZtlhei8 Part 3 http://www.youtube.com/watch?v=9DjqFpS6Nw8

Apply textures

Export to COLLADA

Before you export your mesh, make sure that it doesn’t have any stray vertices, overlapping edges, or ngons (polygons that have more than four vertices). These will either cause unexpected visual results in Second Life or worse, the mesh will fail to upload entirely.

Once that’s done, select the mesh and...

1. Go to File --> Export --> Export Selected

2. Select the directory you wish to save the exported .dae file and create a name for it.

3. In the “Save as type:” drop down menu, select “Autodesk Collada (.DAE)”. Note: If you are using an older version of Max that does not have this file type available, you will need to download the OpenCollada Plugin and select “OpenCOLLADA (.DAE)” from the menu list.

4. Autodesk Collada export will open a FBX Export dialog box. You shouldn’t need to change much to the default settings. If you’re exporting a skinned mesh, make sure “Animation” and “Deformations” are checked off. For all meshes, make sure that the “Up Axis” is set to “Z-up”. If the axis isn’t set to Z-up, the mesh axis(and the rig data) will be flipped on its side and/or rotated in Second Life. This will wreak havoc on a skinned mesh.

Import to SL

Best practices

[NOTE: All these links need to be updated because of the Forum software changing, and the threads being archived]

Forum thread on 3ds Max best practices

Forum request for input on debugging 3ds Max import workflow

Another forum thread on exporting a rigged mesh from 3ds Max

Forum thread on UVW mapping, mostly about 3ds Max

Forum thread on texturing in Max and uploading to Second Life

Bones and rigging

This is written for 3ds Max 2010. Other workflows may work also, but this one has been tested and works with Viewer 3.0

  • Units need to be metric cm or meters. See above for how to set that.
  • Your model should be editable poly when done making the geometry (the shape). You can use other object types while making it, but in final form it should be Editable Poly.
  • It should be at human scale (about 1.8 m tall), facing +X direction, with pivot at 0,0,0 and avatar standing on same point (feet at Z=0).
  • Use Command Panel > Utilities > Reset transforms to null out any scaling or rotation. The model should show at 100% size and 0 angles.
  • If your model is more than one named object in Max, it will import as separate objects. Use the attach button in Editable Poly rollout to combine objects if you want it as a single one.
  • Make sure you have no degenerate triangles (triangles with zero width), stray or duplicated vertices, etc. It needs to be a clean model.
  • Maximum complexity for import is 64K vertices. Upload and prim cost depends on model size and complexity.
  • You can apply a maximum of 8 submaterial slots in a Multi/SubObject material, using default shader, applied to whole object.
  • It needs UV map coordinates if you want to apply a texture. Otherwise SL will have no information on what part of the texture goes on what polygons of the model.
  • Once imported, each submaterial ID functions like a "side" on a prim for applying textures. Imported models are one-sided for textures. The other side is transparent. If you want it to be seen from both sides, you need additional triangles facing the other way. Make sure normals point in the direction you will see once imported.
  • Use smoothing groups when you have curved shapes. Any polygons in different smoothing groups will show a hard edge between them. Hard edges will increase the vertex count in the upload window. They need duplicated vertexes with different normals to make the edge.
  • Apply "Skin" modifier last, after UV mapping. You might want to do test imports on Aditi at each stage before rigging to find problems in those stages.
  • Get the SLAV 3ds Max Plugin, which has a set of bones for the SL avatar pre-made. You may need to scale and rotate the bone rig to human size, and facing same direction as your model.
  • Put all 26 bones into skin modifier even if you don't need them all. Bone names and hierarchy needs to match that of SL avatar.
  • All vertexes need to be weighted to 1.0 total (no unweighted or partially weighted ones). At joints weight vertexes to the two or more nearest bones to get a smooth bend.
  • Delete everything from the scene besides the bone skeleton and your model before export. Save a copy with extra objects if you want, then a second one stripped to those two for export.
  • Export using Autodesk Collada using FBX 2011.3 plugin. If you are not using Max 2011, update to that plugin, or if using 2012, export to FBX, and use standalone 2011 FBX converter. The 2012 exporter was using a later version of Collada (1.4.1) than the SL software could read (1.4). That may have been fixed by now.
  • Click Z-up on the export window. Other settings are OK as default.
  • Once Collada .dae file is created, open it with any text editor (its an XML type text file), and find a string that looks like:

<Name_array id="DefaultClothingItemController-Joints-array" count="26">

If it doesn't say 26, change it to 26. Just after that, add whatever bones you didn't weight after the ones you did weight (which should be there). The importer has been requiring all the bones listed. That may also have been fixed, but to be sure list them all. Ones you actually use go first, then the rest in any order. Here is a full list:

mHipRight mKneeRight mAnkleRight mFootRight mToeRight mHipLeft mKneeLeft mAnkleLeft mFootLeft mToeLeft mPelvis mTorso mChest mNeck mHead mSkull mEyeRight mEyeLeft mCollarLeft mShoulderLeft mElbowLeft mWristLeft mCollarRight mShoulderRight mElbowRight mWristRight

  • On the SL importer, go to the third tab, and click "Skin weights". I recommend doing your test imports on the beta grid (Aditi) because it uses fake L$. Once the items is perfect, you can import once on the main grid. Model will appear in the import window in white, possibly small. It can be rotated and zoomed
  • The importer creates a .slm file in the same folder as your Collada .dae file, to save your upload settings. This often causes problems if you change the model and upload again, so delete it.

Gotchas and workarounds

Optimization techniques

Tutorial links