视频教程
界面
要领
高级
实用建议
UnigineEditor
界面概述
设置和首选项
项目开发
调整节点参数
Setting Up Materials
Setting Up Properties
照明
Landscape Tool
Sandworm
使用编辑器工具执行特定任务
Extending Editor Functionality
嵌入式节点类型
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Objects
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
创建内容
Content Optimization
Materials
Art Samples
Tutorials

FBX导入指南

FBX is a file format owned by Autodesk that is used to provide interoperability between various Digital Content Creation (DCC) applications. Most of modern 3D modelling applications support export to FBX: Autodesk Maya, Autodesk 3ds Max, Blender, Modo, etc.FBX是Autodesk拥有的文件格式,用于提供各种数字内容创建(DCC)应用程序之间的互操作性。大多数现代3D建模应用程序都支持导出到FBX:Autodesk Maya,Autodesk 3ds Max,Blender,Modo等。

UNIGINE's FBX import pipeline allows simple transfer of content from any DCC application that supports this format.UNIGINE的FBX导入管道允许从支持该格式的任何DCC应用程序简单地传输内容。

The advantages of using FBX Import over other importing methods are:与其他导入方法相比,使用FBX导入的优点是:

  • Static meshes, skeletal meshes, animations, and morph targets are combined in a single file format.静态网格物体,骨架网格物体,动画和变形目标以单个文件格式组合。
  • Multiple assets can be contained in a single file.一个文件中可以包含多个资产。
  • Import of multiple LODs and morph targets in a single import operation.在单个导入操作中导入多个LOD和变形目标。
  • Materials and textures can be imported with and applied to meshes.材质和纹理可以与网格一起导入并应用于网格。
  • Cameras and light sources can also be imported.摄像机和光源也可以导入。

Along with importing data from FBX containers, UNIGINE also provides an ability to export data to .fbx files.除了从FBX容器导入数据外,UNIGINE还提供了以下功能:将数据导出到.fbx文件

注意
For the FBX asset to be imported, the FbxImporter plugin must be loaded.对于要导入的FBX资产,必须加载FbxImporter插件。

Importing FBX Asset导入FBX资产#

When you import an FBX asset (just like importing any other asset), the import settings window appears:导入FBX资产时(就像进口任何其他资产),出现导入设置窗口:

注意
To simplify sequential import of multiple similar assets, Asset Browser remembers previous asset import settings and offers to use them by default. To reset import settings to system defaults use the Restore Defaults button.为了简化多个相似资产的顺序导入,Asset Browser会记住以前的资产导入设置,并默认提供使用它们的功能。要将导入设置重置为系统默认值,请使用Restore Defaults按钮。

The list of available import options covers all components that can be imported from an FBX scene and includes the following:可用的导入选项列表涵盖了可以从FBX场景导入的所有组件,包括以下内容:

Mesh Import Options网格导入选项#

Import Meshes Import geometry meshes from the file.从文件导入几何体网格。
Use Instances Imports FBX with mesh instances. When enabled, a single mesh is imported instead of several identical ones. If you add such FBX to the scene, all meshes in the World Hierarchy will refer to the single mesh stored inside the imported FBX container.导入带有网格物体实例的FBX。启用后,将导入单个网格,而不是多个相同的网格。如果将此类FBX添加到场景中,则“世界层次”中的所有网格都将引用存储在导入的FBX容器内的单个网格。
Merge Static Meshes Merges all of the children static meshes into a single one (named after the parent mesh). All surfaces of all meshes surfaces will be copied and shown in the Surfaces hierarchy.将所有子静态网格物体合并为一个(以父网格物体命名)。所有网格曲面的所有曲面都将被复制并显示在Surfaces层次结构中。
Merge Surfaces by Materials Enables merging surfaces that have the same materials.启用具有相同材质的合并曲面。
Split by Grid

Enables splitting of imported meshes. Too large models having sizes, that exceed 10000 units may have various artefacts (jitter, etc.) associated with positioning errors. You can eliminate such artefacts by splitting your mesh into multiple separate meshes. To do so, just enable this option and set the size of the grid cell (see the Grid Size parameter below) to be used for mesh splitting.启用导入网格的拆分。尺寸超过10000单位的模型太大,可能会出现与定位误差相关的各种伪像(抖动等)。您可以通过将网格划分为多个单独的网格来消除此类伪影。为此,只需启用此选项并设置用于网格划分的网格单元的大小(请参见下面的Grid Size参数)。

注意
This option does not split surfaces.此选项不会拆分曲面。
Grid Size Size of the grid cell to split imported meshes, in units.划分导入的网格的网格单元的大小,以单位为单位。
Repivot to Center Places a pivot of generated mesh to its center. Can be used for meshes having their geometry located too far from their pivot, as this may lead to various artefacts (jitter, etc.) associated with positioning errors.将生成的网格的枢轴放置到其中心。可以用于其几何形状离其轴心太远的网格,因为这可能导致与定位误差相关的各种伪像(抖动等)。
Optimize Vertex Cache Enables vertex cache optimization. This option reorders an indexed triangle list to improve vertex cache utilization at runtime. It can be turned off to accelerate saving process; however, it should always be turned on if saving the final version.启用顶点缓存优化。此选项对索引的三角形列表重新排序,以提高运行时的顶点缓存利用率。可以将其关闭以加快保存过程;但是,如果保存最终版本,则应始终将其打开。
Correct Triangulation

Enables correct triangulation of meshes, NURBS and patches.启用网格,NURBS和面片的正确三角剖分。

注意
Disabling this option decreases import time, but may lead to triangulation errors resulting in incorrect geometry.禁用此选项会减少导入时间,但可能会导致三角剖分错误,从而导致几何图形不正确。
Import Tangent Space

Imports built-in tangent space data instead of recalculating it.导入内置切线空间数据,而不是重新计算。

注意
If the option is checked, but an FBX asset has no tangent space, it will be calculated with orientation for the right-handed coordinate system.如果选中该选项,但是FBX资产没有切线空间,则将使用右手坐标系的方向进行计算。
Import Morph Targets Enables importing morph targets from the file.允许从文件导入变形目标。
Combine by Postfixes Enables automatic creation of the Levels of Detail (LODs).启用自动创建详细级别(LOD)

Levels of Detail详细程度#

To create several variations of one object with different level of detail (LODs) you should have them as separate surfaces of the object. This will allow you to reduce the number of nodes in the hierarchy and simplify the settings of the LODs visibility.为一个具有不同详细程度的对象创建多个变体(检出限),则应将它们作为对象的单独表面。这将允许您减少层次结构中的节点数量,并简化LOD可见性的设置。

UNIGINE provides automatic creation of LODs based on the name postfixes. So you can create and export different meshes for different LODs of you model in a single FBX file. When naming these meshes, you should add a postfix to specify the LOD each mesh represents.UNIGINE提供基于名称后缀的LOD的自动创建。因此,您可以在单个FBX文件中为模型的不同LOD创建和导出不同的网格。在命名这些网格物体时,应添加一个后缀以指定每个网格物体所代表的LOD。

You can also enable the Merge Static Meshes option for more optimization.您还可以启用Merge Static Meshes选项以进行更多优化。

  1. Enable the Combine by Postfixes parameter.启用Combine by Postfixes参数。

    This will show additional LODs settings:这将显示其他LOD设置:

    Max Count Number of Levels of Detail.详细级别数。
    Postfix Surface name postfix that determines the current LOD.确定当前LOD的表面名称后缀。
    Min Visibility

    The minimum distance on which this LOD is visible in camera local axes.在摄像机局部轴上可见此LOD的最小距离。

    -inf — the LOD is visible by default.-inf-默认情况下,LOD可见。

  2. Select the number of LODs that are stored in the FBX container.选择存储在FBX容器中的LOD数量。
  3. For each LOD, define a postfix that will be used to group objects in an FBX file into a corresponding LOD.对于每个LOD,定义一个后缀,该后缀将用于将FBX文件中的对象分组为相应的LOD。

    注意
    The postfix must be the same as the one used when creating objects in a 3D editor.后缀必须与在3D编辑器中创建对象时使用的后缀相同。

    The names of generated surfaces will be as follows: material_name + LOD_postfix.生成的曲面的名称如下:material_name + LOD_postfix

  4. Specify minimum visibility distance for each LOD. Maximum visibility distance of each LOD is equal to the minimum visibility distance of the next LOD. Maximum visibility distance of the last LOD is equal to inf.指定每个LOD的最小可见距离。每个LOD的最大可见距离等于下一个LOD的最小可见距离。最后一个LOD的最大可见距离等于inf

Lightmaps Options光照贴图选项#

UV For Lightmap UV channel to be used for lightmaps.紫外线用于光照贴图的通道。
Lightmap Target Resolution Resolution of lightmap texture.光照贴图纹理的分辨率。
Unwrap UV Channel 0 Enables automatic unwrapping for UV Channel 0.启用自动展开紫外线频道0。
Unwrap UV Channel 1 Enables automatic unwrapping for UV Channel 1.启用自动展开紫外线频道1。

Hierarchy Options层次结构选项#

This auxiliary section is available in the Parameters window when selecting an imported FBX asset in the Asset Browser. It enables you to preview the content of the FBX asset according to the current Mesh Import Options.在资产浏览器中选择导入的FBX资产时,该辅助部分可在Parameters窗口中使用。它使您可以根据当前预览FBX资产的内容。网格导入选项

Nodes List of nodes obtained from the FBX asset.从FBX资产获得的节点列表。
Surfaces List of surfaces of the selected node.所选节点的曲面列表。
Use Custom Settings Enables custom Lightmaps options for the selected surface(s).启用自定义光照贴图选定表面的选项。

Material Import Options物料导入选项#

Import Materials Enables importing materials from the file.启用从文件导入材料。
Assets Mode

Enables to choose whether to use existing materials or to overwrite them with the ones imported. Available options:允许选择是使用现有材料还是用导入的材料覆盖它们。可用选项:

  • Take From Assets — use existing materials (if any).Take From Assets-使用现有材料(如果有)。
  • Overwrite Assets — overwrite existing materials (if any).Overwrite Assets —覆盖现有材料(如果有)。
Workflow

Provides an interface to choose a workflow for the imported physically based materials (if any). Available options:提供一个界面来选择工作流程进口的基于物理的材料(如果有)。可用选项:

  • Metalness workflow — uses the new standard of textures (albedo, metalness, roughness).Metalness workflow —使用纹理的新标准(反照率,金属度,粗糙度)。
  • Specular workflow — uses the old standard of textures that was used in mesh_base material (diffuse, specular, gloss).Specular workflow-使用mesh_base材料中使用的旧纹理标准(漫反射,镜面反射,光泽)。
Add Asset Name as Prefix Enables to add a prefix for imported materials to avoid collision of names.允许为导入的材料添加前缀,以避免名称冲突。
Add Prefix Enabling this option makes the name of each material have the name of the imported FBX asset as a prefix.启用此选项会使每种材料的名称具有导入的FBX资产的名称作为前缀。
Merge Similar Materials Enables to merge materials with the same settings, but different names.可以合并具有相同设置但名称不同的材料。

Animation Import Options动画导入选项#

Import Animations Enables importing animations from the file.允许从文件导入动画。
Import Bones Without Skin Enables import of bones that are not attached to the skeleton and do not affect the animation's skin, for example, a weapon held in the character's hands. If disabled, such bone is not imported and bones connected to it, if any, become orphans.允许导入未连接到骨架且不影响动画皮肤的骨骼,例如,角色手中持有的武器。如果禁用,则不会导入此类骨骼,并且与之相连的骨骼(如果有)将成为孤儿。
Create Transform Bones for Joints Imports the hierarchy of the joints (bones) for animated FBX assets as a list of World Transform Bones. If this option is disabled, imported animations for a mesh will still work.导入动画FBX资产的关节(骨骼)的层次结构作为World Transform Bones的列表。如果禁用此选项,导入的动画对于网格仍然可以使用。
Joints Reorientation Enables changing orientation of bones for animations and animated geometry. When enabled, all bones will have the same forward axis as the geometry. This simplifies work with animations via code for programmers reducing excessive axis manipulations: if a mesh has +Y as a forward axis, the bones will have +Y as well.为动画和动画几何体启用更改骨骼的方向。启用后,所有骨骼的前向轴将与几何图形相同。这为程序员简化了通过代码进行动画处理的工作,减少了过多的轴操作:如果网格的前向轴为+Y,则骨骼也将为+Y
Animation FPS Number of frames per second of imported animation.每秒导入的动画的帧数。
Force Loop

Forced smoothing of looped animation playback.强制平滑循环动画的播放。

Looped Frames Number of frames to be used for smoothing of looped animation playback. The specified number of frames is taken from the beginning and from the end of the animation. If the specified value exceeds the (total_number_of_frames)/2, the latter is used instead.用于平滑循环播放动画的帧数。指定的帧数是从动画的开头和结尾开始获取的。如果指定的值超过(total_number_of_frames)/2,则使用后者。

Other Import Options其他导入选项#

Import Textures Enables importing textures from the file.启用从文件导入纹理。
Import Lights Imports light sources from an FBX scene.从FBX场景导入光源。
Import Cameras Imports cameras from an FBX scene.从FBX场景导入摄像机。
Skip Empty Nodes Enables skipping empty nodes. Complex CAD models may contain a lot of empty nodes, resulting in an overloaded world hierarchy. You can enable this option to simplify generated hierarchy by ignoring nodes, that do not contain any useful information.启用跳过空节点。复杂的CAD模型可能包含许多空节点,从而导致世界层次结构过载。您可以启用此选项,以通过忽略不包含任何有用信息的节点来简化生成的层次结构。
Front Axis Provides an interface to choose an axis to be considered as the forward vector of the World Coordinate System.提供一个接口,以选择要被视为世界坐标系的正向向量的轴。
Up Axis Provides an interface to choose an axis to be considered as the up vector of the World Coordinate System.提供一个接口,以选择要被视为世界坐标系的向上向量的轴。
Scale

Geometry scale multiplier.几何比例乘数。

When added to the scene in UNIGINE, your mesh might require scaling to fit properly. However, applying the Scale transformation to the mesh affects its physics — the mesh cannot participate in collision properly in this case. Therefore, it is recommended to define the required scale value using the scale manipulator and then re-import the mesh using the resulting value, which is displayed in the Common Parameters.当在UNIGINE中添加到场景中时,您的网格可能需要缩放以正确适合。但是,将Scale转换应用于网格会影响其物理效果-在这种情况下,网格无法正确参与碰撞。因此,建议使用规模操纵器然后使用结果值重新导入网格,该值显示在常用参数

Specific options for various types of data stored in an FBX container are described below.下面描述了存储在FBX容器中的各种类型数据的特定选项。

Geometry几何学#

The most commonly used type of data stored in an FBX container is polygonal geometry.FBX容器中存储的最常用数据类型是多边形几何。

To import 3D geometry data contained in an FBX scene, you should enable the Import Meshes option.要导入FBX场景中包含的3D几何数据,应启用Import Meshes选项。

Imported geometry (same as any object in the scene) after being added to the world, becomes a node and can be seen in the World Hierarchy window. This node will have the same name as the imported FBX asset and a hierarchy of child nodes representing the hierarchy of static meshes contained in the imported scene. 导入的几何图形(与场景中的任何对象相同)在添加到世界后变为节点并可以在World Hierarchy窗口中看到。该节点的名称与导入的FBX资产的名称相同,子节点的层次结构表示包含在导入场景中的静态网格物体的层次结构。

You can combine all child objects into a single one by enabling the Merge Static Meshes option. In this case, all surfaces of child meshes will be copied to the single parent mesh and will appear in its Surfaces hierarchy.您可以通过启用Merge Static Meshes选项将所有子对象合并为一个。在这种情况下,子网格物体的所有表面将被复制到单个父网格物体,并将出现在其Surfaces层次结构中。

Surfaces of a single mesh generated instead of separate meshes with device_calculator and glass_mat materials assigned生成单个网格的表面,而不是分配了device_calculatorglass_mat材料的单独网格

You can also merge the surfaces having the same material assigned by enabling the Merge Surfaces by Materials option.您也可以通过启用Merge Surfaces by Materials选项合并具有相同材质的曲面。

Surfaces merged by materials材料合并的表面

注意
When importing geometry keep in mind the limitations set in UNIGINE for the maximum number of vertices per surface. It is 4294967295 for any type of mesh. 导入几何时,请记住在UNIGINE中设置的限制,即每个曲面的最大顶点数。对于任何类型的,它都是4294967295

Different measurement systems can be used in different 3D modelling applications. To adjust the scale of imported geometry, you can use the Scale parameter.可以在不同的3D建模应用程序中使用不同的测量系统。要调整导入几何的比例,可以使用Scale参数。

It is also possible to optimize the vertex cache when importing geometry. To do so, use the Optimize Vertex Cache option.导入几何体时也可以优化顶点缓存。为此,请使用Optimize Vertex Cache选项。

The Import Tangent Space option allows importing built-in tangent space data instead of recalculating it.Import Tangent Space选项允许导入内置切线空间数据,而无需重新计算。

Materials材料#

An FBX container can also store materials assigned to the surfaces of the objects in a 3D editor.FBX容器还可以在3D编辑器中存储分配给对象表面的材质。

To import materials from an FBX container, you should enable the Import Materials option. In this case, the surfaces of the imported model will have the corresponding materials assigned.要从FBX容器导入材料,应启用Import Materials选项。在这种情况下,将为导入的模型的曲面分配相应的材料。

注意
If materials are imported, the material assets are created in the materials subfolder of the folder where the .fbx asset is stored.如果材料是进口的,则该材料资产在存储.fbx资产的文件夹的materials子文件夹中创建。

The following textures will be imported and assigned (if any):以下纹理将被导入和分配(如果有):

  • Diffuse (albedo) texture
  • Normal map or bump map (needs to be converted into 2-channel (RG) for Unigine)
  • Specular texture
  • Light map

The following material parameters will also be imported (if defined):还将导入以下材料参数(如果已定义):

  • Diffuse color
  • Specular color and power
  • Emission color
注意
You should adjust other material settings manually.你应该调整其他材质设置手动。

When the Import Materials option is disabled, all surfaces of the model will have the default mesh_base material assigned. 禁用Import Materials选项时,将为模型的所有曲面分配默认的mesh_base材质。

When importing materials, you might have a situation when a material with a given name already exists in the project. You can choose whether to overwrite existing materials (the corresponding assets will be overwritten) or not. For this purpose, the Overwrite Existing Materials option is used. When unchecked, existing materials will be used.导入材料时,项目中可能已经存在具有给定名称的材料。您可以选择是否覆盖现有材料(对应的资产将被覆盖)。为此,使用了Overwrite Existing Materials选项。如果未选中,则将使用现有材料。

In case when a source model contains lots of objects with many identical materials that just have different names (often happens when an FBX file was exported from a CAD system), it makes sense to combine such materials into a single one. To do so, you should enable the Merge Similar Materials option.如果源模型包含许多具有许多相同材质但名称不同的对象(通常是从FBX文件中导出FBX文件时发生的)电脑辅助设计系统),将这些材料合并为一个材料是有意义的。为此,您应该启用Merge Similar Materials选项。

UNIGINE supports two workflows for PBR materials: Metalness and Specular. Use the Workflow option to set the desired workflow.UNIGINE支持两种PBR材料工作流程:MetalnessSpecular。使用Workflow选项设置所需的工作流程。

Textures贴图#

When reading the materials data, you are also able to import textures stored in an FBX container. To do so, enable the Import Textures option.读取材料数据时,您还可以导入存储在FBX容器中的纹理。为此,启用Import Textures选项。

注意
If textures are imported, the corresponding texture assets are created in the same folder, where the .fbx asset is stored.如果导入纹理,则对应的纹理资产在存储.fbx资产的同一文件夹中创建。

Animation and Morph Targets动画和变形目标#

You can import skeletal animations and morph targets from an FBX file.您可以从FBX文件导入骨骼动画和变形目标。

To import animations from an FBX container:要从FBX容器导入动画,请执行以下操作:

To import morph targets just enable the Import Morph Targets option. Morph targets will be imported as child nodes.要导入变形目标,只需启用Import Morph Targets选项。变形目标将作为子节点导入。

If you have an FBX file containing skeletal animation without any geometry, you can import it to your UNIGINE project via the Import Bones Without Skin and use generated .anim files.如果您有一个FBX文件,其中包含没有任何几何图形的骨骼动画,则可以通过Import Bones Without Skin将其导入到UNIGINE项目中,并使用生成的.anim文件。

Lights#

You can import light sources from an FBX scene (if any) by simply enabling the Import Lights option. Imported light sources will be added as child nodes to the root node. The following conversion will be performed:您可以通过简单地启用Import Lights选项从FBX场景导入光源(如果有)。导入的光源将作为子节点添加到根节点。将执行以下转换:

  • Directional lights are converted into world light sources.定向光将转换为world光源。
  • Point lights are converted into omni light sources.点光源将转换为omni光源。
  • Spot lights are converted into projected light sources.聚光灯转换为projected光源。

The following parameters of lights are automatically imported into UNIGINE, so there is no need to set them up twice:以下灯光参数会自动导入到UNIGINE中,因此无需将它们设置两次:

  • Light color浅色
  • Light radius and attenuation光半径和衰减
  • Light source position and orientation光源位置和方向

Cameras摄影机#

Cameras can also be imported from an FBX scene (if they exist) by simply enabling the Import Cameras option. They are converted into PlayerDummy (cameras without physical properties). Both types of projection are supported in UNIGINE:只需启用Import Cameras选项,也可以从FBX场景导入摄像机(如果存在)。它们被转换为PlayerDummy(没有物理属性的相机)。 UNIGINE支持两种类型的投影:

  • Orthographic (with Z near and far clipping planes support)正交(具有Z远近裁剪平面支持)
  • Perspective (with FOV support)透视图(在FOV支持下)

To view the scene through the imported camera choose its name in the drop-down list in the top left corner of the Editor Viewport window.要通过导入的摄像机查看场景,请在Editor Viewport窗口左上角的下拉列表中选择其名称。

Adding Imported FBX Asset to the World将导入的FBX资产添加到世界#

To add a new imported FBX asset to the scene, as any other asset, simply drag it from the Asset Browser to the Viewport window. The corresponding node will be created and displayed in the World Hierarchy window. This node will have the same name as the imported FBX asset and a hierarchy of child nodes representing separate objects contained in the 3D model.要将新导入的FBX资产与其他资产一样添加到场景中,只需将其从Asset Browser拖动到Viewport窗口即可。相应的节点将被创建并显示在World Hierarchy窗口中。该节点的名称与导入的FBX资产的名称相同,并且子节点的层次结构代表3D模型中包含的单独对象。

Non-native geometry asset types (fbx, obj, dae, etc.) are containers for meshes. If you double-click such asset in the Asset Browser (or use the right-click Open command), the generated runtime .mesh, .anim and .node files stored in the container asset will be displayed:非本机几何图形资产类型(fbx, obj, dae等)是网格的容器。如果您在Asset Browser中双击此类资产(或使用右键单击Open命令),则生成的运行时将显示存储在容器资产中的.mesh, .anim.node文件:

Opening FBX Container打开FBX容器

Video Tutorial: Importing 3D Models视频教程:导入3D模型#

最新更新: 2021-05-01
Build: ()