Unity 的物理系统和光照系统希望游戏世界中的 1 米在导入的模型文件中为 1 个单位。
不同 3D 包的默认值如下:
将模型文件从具有不同缩放因子的 3D 建模应用程序导入 Unity 时,可以通过启用 Convert Units 选项将文件单位转换为使用 Unity 比例。
在将文件导入 Unity 之前,您应该遵循一些步骤以确保以最佳方式优化您的文件。
思考您希望导出的内容:有些场景对象必不可少,而其他则可能不必要。因此您可以通过仅保留基本对象来优化 Unity 中的数据。这有助于从场景中删除不需要的数据,还意味着您可以使用预设或自定义场景导出器以自动化或简化选择导出过程。
下表列出了为使每种资源类型在 Unity 中发挥最佳效果而应考虑的特殊注意事项:
Object | 准备 |
---|---|
网格 (Meshes) | 必须将所有 NURBS、NURMS、样条曲线、面片和细分曲面转换为多边形(三角形剖分或四边形剖分) |
烘焙变形体 (Bake deformers) | 在导出为 .fbx 文件格式之前,请确保将变形体烘焙到应用程序中的模型上。例如,如果要从 Maya 导出复杂骨架,则可以在将模型导出到 .fbx 之前将变形烘焙到蒙皮权重上。 |
纹理 (Textures) | 确保您应用程序的纹理来自 Unity 项目,或者将它们复制到 Unity 项目中的名为 Textures 的文件夹。注意:建议不要使用 Embed Media 选项在 .fbx 文件中嵌入纹理。由于 Unity 在使用纹理之前必须先进行提取,因此嵌入它们会导致项目臃肿并减慢导入过程。 |
平滑 (Smoothing) | 如果要导入混合形状法线,则 .fbx 文件中必须有平滑组。 |
在导出 .fbx 文件之前,请确保使用 3D 建模应用程序支持的最新版本的 .fbx 导出器。导出到 .fbx 时,记录 3D 建模应用程序的导出对话框中的每项设置,以便匹配 Unity 中的 .fbx 导入设置。大多数 .fbx 导出器允许您启用或禁用某些动画、摄像机和灯光效果的导出,因此如果在导入 Unity 时发现缺少任何内容,请检查该内容是否已导出。
在将 .fbx 文件导入 Unity 之前,请验证导出文件的大小。对文件大小执行完整性检查(例如,查看文件大小是否大于 10KB)。将 .fbx 文件重新导回到用于生成该文件的 3D 建模软件中(例如导入到新场景中)。检查并确保能正常工作。
要将文件导入 Unity,请遵循有关导入操作的说明,务必记住您在 3D 建模软件中的导出选项设置。
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.