导入
导入人形动画

Importing Models

Model files can contain a variety of data, such as character and terrain Meshes, Animation Rigs and Clips, as well as Materials and Textures. Most likely, your file does not contain all of these elements at once, but you can follow any portion of the workflow that you need to:

  1. Select the file in the Project view to see the Import Settings window
  2. Set any Model-specific or general importer options
  3. Set up options for importing Rigs and Animation (not available for SpeedTree Models)
  4. Dealing with Materials and Textures
  5. Drag the file into Unity

Note: This workflow assumes you already have a Model file to import. If you don’t have a file already, you can read the guidelines on how to export an FBX file before exporting it from your 3D modeling software. For guidelines on how to export Humanoid animation from your 3D modeling software, see Humanoid Asset preparation.

Accessing the Import Settings window

无论要从模型文件中提取哪种数据,始终以相同的方式开始:

1.打开 Project 窗口和 __Inspector__,确保能同时看到这两个界面。

  1. Select the Model file you want to import from the Asset folder in the Project window.

    The Import Settings window opens in the Inspector showing the Model tab by default.

Setting Model-specific and general importer options

The options that are available for SpeedTree Models vs. other Models are very different. For example, the SpeedTree Model tab provides options mostly for setting up transitions between LOD levels.

Character and animated Models provide more diverse options on their Model tab, which allow you to:

  • Use the Scale Factor and Convert Units properties to adjust how Unity interprets units. For example, 3ds Max uses 1 unit to represent 10 centimeters, whereas Unity uses 1 unit to represent 1 meter.
  • 使用 Mesh CompressionRead/Write EnabledOptimize MeshKeep QuadsIndex FormatWeld Vertices 属性可减少资源并节省内存。
  • 如果模型文件来自 Maya 或 3ds Max,或者任何其他支持变形目标动画的 3D 建模应用程序,则可以启用 Import BlendShapes 选项。
  • 可为环境几何形状启用 Generate Colliders 选项。
  • 可启用特定的 FBX 设置,如 Import VisibilityImport CamerasImport Lights
  • 对于仅包含动画的模型文件,可启用 Preserve Hierarchy 选项以防止骨架层级视图不匹配。
  • 如果使用了__光照贴图 (Lightmap),则可设置 Swap UVs__ 和 Generate Lightmap UVs
  • 可使用 NormalsNormals ModeTangentsSmoothing Angle 选项来控制 Unity 如何处理模型中的法线 (Normals) 和切线 (Tangents)。

Setting options for importing Rigs and Animation

如果文件包含动画数据,可遵循使用 Rig 选项卡设置骨架并使用 Animation 选项卡提取或定义动画剪辑的准则。人形和通用(非人形)动画类型的工作流程不同,因为 Unity 要求人形类型有非常具体的骨骼结构,但对于通用类型只需了解哪个骨骼是根节点:

Note: SpeedTree Models have neither a Rig nor an Animation tab.

Dealing with Materials and Textures

如果文件包含__材质__或__纹理__,可定义它们的处理方式:

1.单击 Import Settings 窗口中的 Materials 选项卡。 2.启用 Import Materials 选项。Materials 选项卡中显示多个选项,包括 Location 选项,该选项的值决定了应显示的其他选项。 3.选择 Use Embedded Materials 选项将导入的材质保持在导入的资源中。 4. When you have finished setting the options, click the Apply button at the bottom of the Import Settings window to save them or click the Revert button to cancel.

Drag the file into Unity

最后,可将文件导入场景中:

  • 如果文件中包含网格,请将文件拖入 Scene 视图以将其实例化为__游戏对象__的__预制件__。
  • 如果文件中包含动画剪辑,可将文件拖入 Animator 窗口以便在状态机中使用,或拖到 Timeline 窗口的__动画轨道 (Animation track)__ 上。也可以将动画连续片段直接拖动到 Scene 视图中的实例化预制件上。此操作将自动创建一个动画控制器 (Animation Controller) 并将动画连接到模型。

导入
导入人形动画