Importing 3d asset from 3ds MAX with FBX export
One of the main problem i have seen so far with Unity3d is the difficulty of getting 3d content inside the application correctly. I have searched the unity3d forum only to find answers that are half satisfying or easy to understand from an artist point of view. By experimenting heavily we reached a point where the formula was found and here it is for your viewing pleasure :
Step one : Modeling
As it is the same with other 3d engines such as Ogre3d. You can actually construct your 3d model in any view. The most important thing to understand is that 3ds max has the Z as the height axis by default. I say height axis because in most engine Y determines the height at which your 3d model will be in 3d space. Z should be for close to far and X right to left. You should set your scale to your scene in meters now look into the 3ds max or in the “customize” -> “Unit setup” menu entry.
Step two : Modify the pivot point
Once the model is made, using your preferred technique, you now have to modify its axis to put the model in a stance where its X,Y,Z are correctly put to export with the FBX exporter. To modify the pivot go to the HIERARCHY tab and then click on the button “Affect object only”. You should experiment from this basic sauce if you have a more complex model (i am after all a programmer !), but for most object i think this should be ok.
You should now see the gizmo with its 3 axises. Click on the button “Edit working pivot” and then select the rotation toolbar button. This should make the rotation circle appear. I would recommend using the “Angle Snap Toggle” toolbar button also to align perfectly the Y axis. The next step is to make the green Y axis point straight up. Its final angle should be 90 degrees. Notice that the model should be facing the opposite direction that the Z axis is pointing. If it is not it would be a nice thing to make it so by either rotating the pivot or the model itself (you must understand that the fbx export will still swap the y axis, so the model will be facing the Z axis in unity)
Here is a snippet of final position with the pivot gizmo
NOTE : You should notice the axises on the bottom and the gizmo difference in orientation
Remember that it is a good practice to position the gizmo at the right place where the position vector (center point) will be represented for this model in unity. (for a walking model, put it between legs, between feets)
Step three : Reset the xform
This step has been a huge headache where at my last job because it is sometimes omitted by the 3d artists. To reset the Xform and thereby making the model use the pivot information, go to the UTILITIES tab and then click on the button “Reset XForm”. That should make the model now use the new pivot reference. This is very important because now you can start to add a skin modifier correctly, bones and animations without further troubles.
Step four : UV Unwrap
I will not go into details about texturing a 3d models, check youtube there is plenty of nice tutorials on that subject…
Step five : Add the bones
Start boning your model if it has animations
Step six : Add the skin modifier
Start skinning and weighting all your vertices for each of your bones
Step seven : Animations
Now you can start to edit animations
Step eight : Export with the FBX exporter
Export to FBX. Be sure to get the latest fbx plugin from autodesk. Be sure to select the “Y-up” axis conversion and meter units. We encountered some warnings about the orientation of Diagonals on Editable Poly objects, but did not had any export problems whatsoever. Visit this link for further information on Unity and FBX export : http://unity3d.com/support/documentation/Manual/HOWTO-ImportObjectMax.html
NOTE : Be sure to specify a FBX version export like 2009 that Unity can understand, lots of problems arises because you did not chose the right version. Scaling is also pretty easy if you set up your units in max to be 1 unit = 1 meter.
This is what should show up in unity for your model when selecting it from the project hierarchy (notice its facing backward here) :
If you drag and drop the 3d model, it should now be axis aligned correctly in the scene (and Z facing) as this screenshot shows :
NOTE : This is a good starting point, it may not be perfect for all cases and you should look for help in the unity forum here for more assistance on this matter.