天天看點

從3D Studio Max導入物體 Importing Objects From 3D Studio Max

原位址:http://game.ceeger.com/Manual/HOWTO-ImportObjectMax.html

If you make your 3D objects in 3dsMax, you can save your .max files directly into your Project or export them into Unity using the Autodesk .FBXformat. Saving them in the original .max format is recommended.

如果你是在3D軟體中制作的物體那麼你可以直接儲存為.max格式放到你的工程目錄下或者使用Autodesk .FBX格式導入到Unity中。推薦使用.max格式。

Unity currently imports from 3ds Max 

能夠從 3ds Max導入unity的資源

  1. All nodes with position, rotation and scale. Pivot points and Names are also imported. 

    所有節點的位移,旋轉,縮放,軸心和命名都将導入

  2. Meshes with vertex colors, normals and one or two UV sets. 

    網格模型包含頂點顔色,法線,一到兩個uv集。

  3. Materials with diffuse texture and color. Multiple materials per mesh. 

    材質包含貼圖以及漫反射顔色,以及單個網格的多元材質。

  4. Animations. 

    動畫 。

  5. Bone based animations. 

    基于骨骼動畫。

To manually export to FBX from 3DS Max

從3DS MAX手動導出FBX格式資源到Unity

  1. Download the latest fbx exporter from Autodesk website and install it. 

    從Autodesk官網下載下傳最新版本的fbx導出插件并安裝。

  2. Export your scene (File->Export or File->Export Selected) in .fbx format. Using default export options should be okay. 

    使用.fbx格式導出你的場景 (File->Export or File->Export Selected) ,使用預設的導出設定就可以。

  3. Move the exported fbx file into your Unity project folder. 

    将導出的fbx檔案放置到你的工程目錄資源檔案夾下。

  4. When you switch back into Unity, the .fbx file is imported automatically. 

    當你切換會Unity程式時.fbx檔案會自動導入到Unity中。

  5. Drag the file from the Project View into the Scene View. 

    從工程面闆将.fbx.檔案拖拽到場景中。

Exporter options 導出選項

Using default FBX exporter options (that basically export everything) should be okay in all cases.

使用預設的FBX導出設定(基本上導出一切)是一個不錯的選擇。

從3D Studio Max導入物體 Importing Objects From 3D Studio Max

Default FBX exporter options (for fbx plugin version 2009.3)

預設FBX導出設定(2009.3版本FBX插件)

Exporting Bone-based Animations 導出基本骨骼動畫

There is a procedure you should follow when you want to export bone-based animations:

下面我們就試着一步一步的學習導出基本骨骼動畫:

  1. Set up the bone structure as you please. 

    按照你的需求設定骨骼結構。

  2. Create the animations you want, using FK and/or IK 

    根據需要使用正向動力學或者反向動力學建立骨骼動畫

  3. Select all bones and/or IK solvers 

    選擇所有的骨骼和IK解算器。

  4. Go to Motion->Trajectories and press Collapse. Unity makes a key filter, so the amount of keys you export is irrelevant 

    轉到Motion(運動)->Trajectories(軌迹)面闆下執行Collapse(塌陷)。Unity會自動過濾關鍵幀,是以導出逐幀動畫也沒有關系。

  5. "Export" or "Export selected" as newest FBX format 

    使用剛剛安裝的FBX插件導出全部場景或者選擇物體為fbx格式。

  6. Drop the FBX file into Assets as usual 

    将導出的FBX檔案放置到資源檔案夾下。

  7. In Unity you must reassign the Texture to the Material in the root bone 

    傳回Unity你必須在根骨骼中從新指定材質中的貼圖資源。

When exporting a bone hierarchy with mesh and animations from 3ds Max to Unity, the GameObject hierarchy produced will correspond to the hierarchy you can see in "Schematic view" in 3ds Max. One difference is Unity will place a GameObject as the new root, containing the animations, and will place the mesh and material information in the root bone.

當從3dsmax導出帶有骨骼層級和動畫的網格物體到Unity時,遊戲物體的層級順序會和你在3ds max大綱視圖中看到的一樣,唯一的不同就是unity會将遊戲物體,骨骼以及動畫,網格和材質資訊放置到一個新的跟根層級下面。

If you prefer to have animation and mesh information in the same Unity GameObject, go to the Hierarchy view in 3ds Max, and parent the mesh node to a bone in the bone hierarchy.

如果你希望在unity中保持在3dsmax大綱視圖中所看到的那樣的層級關系,可以将你的網格物體(模型)作為根骨骼的子物體。

Exporting Two UV Sets for Lightmapping 導出2個UV集用于光照貼圖

3ds Max' Render To Texture and automatic unwrapping functionality can be used to create lightmaps. Note that Unity has built-in lightmapper, but you might prefer using 3dsmax if that fits your workflow better. Usually one UV set is used for main texture and/or normal maps, and another UV set is used for the lightmap texture. For both UV sets to come through properly, the material in 3ds Max has to be Standard and both Diffuse (for main texture) and Self-Illumination (for lightmap) map slots have to be set up:

3ds Max的渲染到紋理和自動展開UV功能能用來建立光照貼圖。注意Unity内置光照貼圖工具,但是在你的工作流程中也許你覺得3dsmax更适合你。通常一個UV集用來定位主要的顔色貼圖,或者法線貼圖,另一個UV集用來定位光照貼圖。

從3D Studio Max導入物體 Importing Objects From 3D Studio Max

Material setup for Lightmapping in 3ds Max, using self-illumination map

材質設定:光照貼圖指定到自發光通道

Note that if object uses a Shell material type, then current Autodesk's FBX exporter will not export UVs correctly.

注意如果物體用了殼材質,那麼使用Autodesk的FBX插件将無法正确的導出UVs。

Alternatively, you can use Multi/Sub Object material type and setup two sub-materials, using the main texture and the lightmap in their diffuse map slots, like shown below. However, if faces in your model use different sub-material IDs, this will result in multiple materials being imported, which is not optimal for performance.

作為選擇,你可以使用多元子材質,就像下圖這樣使用兩個子材質,分别在兩個不同的貼圖通道中指定漫反射貼圖和光照貼圖。如果你的模型面上使用了多個材質ID那麼導出時會生成多個材質球。不過這樣的做法從優化角度來說十分消耗性能。

從3D Studio Max導入物體 Importing Objects From 3D Studio Max

Alternate Material setup for Lightmapping in 3ds Max, using multi/sub object material

3ds Max中使用多元子材質來設定光照貼圖。

Troubleshooting 故障排除

If you have any issues with importing some models: ensure that you have the latest FBX plugin installed. It can be downloaded Autodesk website.

如果你在導出模型的時候遇到一些小問題: 確定你的系統中安裝了最新版本的FBX插件。你可以在Autodesk的官網下載下傳FBX插件。

頁面最後更新:2010-09-16