網(wǎng)格組成您的3D世界很大的一部分。Unity沒有創(chuàng)建網(wǎng)格的工具,但是Unity與有普遍流行的3D建模軟件很好的交互性。導(dǎo)入模型是一件很簡單的事,但以下頁面記錄了一些你需要注意的事情。
Unity will attempt to find the textures used by a mesh automatically on import by following a specific search plan. First, the importer will look for a sub-folder called Textures within the same folder as the mesh or in any parent folder. If this fails, an exhaustive search of all textures in the project will be carried out. Although slightly slower, the main disadvantage of the exhaustive search is that there could be two or more textures in the project with the same name. In this case, it is not guaranteed that the right one will be found.
Unity會(huì)根據(jù)下述尋找貼圖的方案來嘗試自動(dòng)的導(dǎo)入與網(wǎng)格相關(guān)的貼圖。首先,貼圖導(dǎo)入器會(huì)尋找與網(wǎng)格在同級或上級文件夾下的Textures子文件夾。如果這樣的查找失敗了,導(dǎo)入器將會(huì)對項(xiàng)目中所有的貼圖進(jìn)行窮舉搜索。窮舉搜索較慢,并且如果當(dāng)有兩個(gè)或多個(gè)同名的貼圖時(shí),窮舉搜索不能保證能找到正確的貼圖,這是窮舉搜索最主要的缺點(diǎn)。
Meshes
網(wǎng)格
Scale Factor
縮放系數(shù)
Unity's physics system expects 1 meter in the game world to be 1 unit in the imported file. If you prefer to model at a different scale then you can compensate for it here.
Unity的物理系統(tǒng)希望游戲世界中的1米為導(dǎo)入文件中的1單位。調(diào)整此參數(shù)可以塑造一個(gè)不同比例的模型
Use File Units
使用文件單位
This option is available only for 3dsMax files. If enabled it imports 3dsMax file with one Max unit equal to one Unity unit, otherwise it imports with 1 cm equal to 1 Unity unit.
此選項(xiàng)僅適用于3dsMax文件。如果啟用此選項(xiàng),以1Max單位 = 1Unity單位導(dǎo)入3DSMAX文件,否則以1厘米= 1Unity單位導(dǎo)入
Mesh Compression
網(wǎng)格壓縮
Increasing this value will reduce the file size of the mesh, but might introduce irregularities. It's best to turn it up as high as possible without the mesh looking too different from the uncompressed version. This is useful for?optimizing game size.
升高這值會(huì)降低網(wǎng)格的文件大小,但可能會(huì)導(dǎo)致謬誤(模型走樣變形)。最好是在與未經(jīng)壓縮網(wǎng)格的版本差異不會(huì)太大的前提下,將其設(shè)置得盡可能高。此選項(xiàng)對優(yōu)化游戲的大。╫ptimizing game size)是有用的。
Mesh Optimization 網(wǎng)格優(yōu)化
This option determines the order in which triangles will be listed in the mesh.
此選項(xiàng)決定了以何種順序?qū)⑷切闻帕性诰W(wǎng)格中
Generate Colliders
產(chǎn)生碰撞體
If this is enabled, your meshes will be imported with Mesh Colliders automatically attached. This is useful for quickly generating a collision mesh for environment geometry, but should be avoided for geometry you will be moving. For more info see Colliders below.
如果啟用該選項(xiàng),網(wǎng)格導(dǎo)入時(shí)會(huì)自動(dòng)生成其網(wǎng)格碰撞體。這對快速生成一個(gè)環(huán)境幾何體的碰撞網(wǎng)格是非常有用的,但應(yīng)避免將其用在要移動(dòng)的幾何體上。欲了解更多信息,請看看下面的碰撞體(Colliders)。
Swap UVs
交換Uv
Use this if lightmapped objects pick up the wrong UV channels. This will swap your primary and secondary UV channels.
當(dāng)有光照貼圖的物體的UV通道不正確時(shí)啟用此選項(xiàng)。這將交換你的主UV通道與次UV通道。
Generate Lightmap UVs
產(chǎn)生光照貼圖UV
Use this to create the second UV channel to be used for Lightmapping.
啟用此選項(xiàng)會(huì)為光照貼圖創(chuàng)建第二個(gè)UV通道。
Advanced Options 高級選項(xiàng)
See Lightmapping UVs document.
Normals & Tangents
法線和切線
Normals 法線
Defines if and how normals should be calculated. This is useful for optimizing game size.
決定是否使用法線和如何計(jì)算法線。此選項(xiàng)對優(yōu)化游戲的大。╫ptimizing game size)是有用的。
Import 導(dǎo)入
Default option. Imports normals from the file.
默認(rèn)選項(xiàng)。從文件導(dǎo)入法線。
Calculate 計(jì)算
Calculates normals based on Smoothing angle. If selected, the Smoothing Angle becomes enabled.
根據(jù)平滑角度(Smoothing angle)計(jì)算法線。如果選中,啟用平滑角度(Smoothing angle)。
None 不使用
Disables normals. Use this option if the mesh is neither normal mapped nor affected by realtime lighting.
禁用法線。如果網(wǎng)格既沒有法線貼圖,也不受實(shí)時(shí)光照影響,則可使用此選項(xiàng)。
Tangents 切線
Defines if and how tangents and binormals should be calculated. This is useful for optimizing game size.
決定是否使用切線和副法線及如何計(jì)算切線和副法線。此選項(xiàng)對優(yōu)化游戲的大小(optimizing game size)是有用的。
Import 導(dǎo)入
Imports tangents and binormals from the file. This option is available only for FBX, Maya and 3dsMax files and only when normals are imported from the file.
從文件導(dǎo)入切線和副法線。此選項(xiàng)僅適用于FBX,Maya和3DSMAX文件,并且只有當(dāng)法線為從文件中導(dǎo)入時(shí)可用。
Calculate 計(jì)算
Default option. Calculates tangents and binormals. This option is available only when normals are either imported or calculated.
默認(rèn)選項(xiàng)。計(jì)算切線和副法線。只有當(dāng)法線為導(dǎo)入或計(jì)算時(shí),此選項(xiàng)可用。
None 不使用
Disables tangents and binormals. The mesh will have no Tangents, so won't work with normal-mapped shaders.
禁用切線和副法線。如網(wǎng)格沒有切線則不能使用法線貼圖著色器。
Smoothing Angle 平滑角
Sets how sharp an edge has to be in order to be treated as a hard edge. It is also used to split normal map tangents.
設(shè)置邊會(huì)被作為硬邊處理的鋒利程度。它還被用來切分法線貼圖切線。
Split Tangents 分離切線
Enable this if normal map lighting is broken by seams on your mesh. This usually only applies to characters.
如果您的網(wǎng)格上的接縫破壞了法線貼圖光照,啟用此選項(xiàng)。這通常只適用于角色。
Materials
材質(zhì)
-
Import Materials 導(dǎo)入材質(zhì)
Disable this if you don't want materials to be generated. Default-Diffuse material will be used instead.
如果您不想U(xiǎn)nity為您生成材質(zhì),禁用此選項(xiàng)。禁用此選項(xiàng)后,所有的材質(zhì)都為默認(rèn)的漫反射材質(zhì)
Material Naming 材質(zhì)命名
Controls how Unity materials are named:
此選項(xiàng)決定了Unity材質(zhì)的命名方式:
<textureName>.mat
<貼圖名>.mat
The name of the diffuse texture of the imported material that will be used to name the material in Unity. When a diffuse texture is not assigned to the material, Unity will use the name of the imported material.
Unity材質(zhì)以導(dǎo)入材質(zhì)中的漫反射貼圖的名字來命名。如果材質(zhì)中沒有漫反射貼圖,Unity會(huì)用導(dǎo)入的材質(zhì)的名字來對材質(zhì)進(jìn)行命名
<materialName>.mat
<材質(zhì)名>.mat
The name of the imported material will be used for naming the Unity material.
Unity材質(zhì)以導(dǎo)入材質(zhì)的名字來命名
<modelFileName>-<materialName>.mat
<模型文件名>-<材質(zhì)名>.mat
The name of the model file in combination with the name of the imported material will be used for naming the Unity material.
Unity材質(zhì)以模型名和導(dǎo)入材質(zhì)的名字來命名
<textureName>.mat or
<modelFileName>-<materialName>.mat
(OBSOLETE)
<貼圖名>.mat或<模型文件名>-<材質(zhì)名>.mat
(已過時(shí))
The name of the diffuse texture of the imported material will be used for naming the Unity material. When a diffuse texture is not assigned or it cannot be located in one of the Textures folders, then the material will be named <modelFileName>-<materialName>.mat instead. This option is backwards compatible with the behavior of Unity 3.4 (and earlier versions). We recommend using <textureName>.mat, because it is less complicated and has more consistent behavior.
Unity材質(zhì)以導(dǎo)入材質(zhì)中的漫反射貼圖的名字來命名,如果材質(zhì)中沒有漫反射貼圖或沒有在Textures文件夾中找到此貼圖,Unity材質(zhì)將會(huì)按<模型文件名>-<材質(zhì)名>.mat來命名。此選項(xiàng)用于對Unity3.4(及更早的版本)進(jìn)行向后兼容。我們推薦您使用<貼圖名>.mat,<貼圖名>.mat比較簡單且有更一致的行為。
Material Search 材質(zhì)搜索
Controls where Unity will try to locate existing materials using the name defined by the Material Naming option:
決定Unity如何根據(jù)材質(zhì)命名選項(xiàng)中定義的名字查找已有的材質(zhì)
Local 本地
Unity will try to find existing materials only in the "local" Materials folder, ie, the Materials subfolder which is the same folder as the model file.
Unity只會(huì)在本地的Materials文件夾中查找已有的材質(zhì),即,與模型文件在同一文件夾下的Materials子文件夾
Recursive-Up 向上遞歸
Unity will try to find existing materials in all Materials subfolders in all parent folders up to the Assets folder.
Unity會(huì)在所有的父文件夾中的Materials子文件夾中查找已有的材質(zhì)
Everywhere
Unity will try to find existing materials in all Unity project folders.
Unity會(huì)在所有的項(xiàng)目文件夾下查找已有的材質(zhì)
Animations
動(dòng)畫
Generation 生成
Controls how animations are imported: 控制如何導(dǎo)入動(dòng)畫:
Don't Import 不導(dǎo)入
No animation or skinning is imported. 不導(dǎo)入動(dòng)畫或蒙皮。
Store in Original Roots
存儲(chǔ)在原始根對象中
Animations are stored in the root objects of your animation package (these might be different from the root objects in Unity).
動(dòng)畫存儲(chǔ)在動(dòng)畫包的根對象中(這可能與Unity中的根對象不同)。
Store in Nodes
存儲(chǔ)在節(jié)點(diǎn)中
Animations are stored together with the objects they animate. Use this when you have a complex animation setup and want full scripting control.
動(dòng)畫與對象存儲(chǔ)在一起。當(dāng)你有一個(gè)復(fù)雜的動(dòng)畫設(shè)置,并希望有完整的腳本控制時(shí)使用此選項(xiàng)。
Store in Root
存儲(chǔ)在根對象中
Animations are stored in the scene's transform root objects. Use this when animating anything that has a hierarchy.
動(dòng)畫存儲(chǔ)在場景的變換根對象中。當(dāng)動(dòng)畫驅(qū)動(dòng)的是有層級結(jié)構(gòu)的物體時(shí)使用此選項(xiàng)。
Bake Animations
烘焙動(dòng)畫
Enable this when using IK or simulation in your animation package. Unity will convert to forward kinematics on import. This option is available only for Maya, 3dsMax and Cinema4D files.
當(dāng)在動(dòng)畫包中使用IK或模擬時(shí),啟用此功能。Unity在導(dǎo)入時(shí)會(huì)轉(zhuǎn)換為前向運(yùn)動(dòng)學(xué)。此選項(xiàng)僅適用于MAYA,3DSMAX和Cinema4D文件。
Animation Wrap mode
動(dòng)畫循環(huán)模式
The default Wrap Mode for the animation in the mesh being imported
網(wǎng)格被導(dǎo)入時(shí),動(dòng)畫默認(rèn)的循環(huán)模式
Default 默認(rèn)
The animation plays as specified in the animation splitting options below.
根據(jù)動(dòng)畫分割選項(xiàng)內(nèi)容播放動(dòng)畫
Once 一次
The animation plays through to the end once and then stops.
動(dòng)畫播放完畢后停止
Loop 循環(huán)
The animation plays through and then restarts when the end is reached.
動(dòng)畫播放完畢后重復(fù)播放
PingPong 乒乓
The animation plays through and then plays in reverse from the end to the start, and so on.
動(dòng)畫播放完畢后反向播放動(dòng)畫
ClampForever 永久鉗制
The animation plays through but the last frame is repeated indefinitely. This is not the same as Once mode because playback does not technically stop at the last frame (which is useful when blending animations).
動(dòng)畫播放完畢后重復(fù)動(dòng)畫的最后一幀。此模式與單次循環(huán)模式不同,因?yàn)樵诓シ偶夹g(shù)上不一定停在最后一幀(這在動(dòng)畫融合時(shí)很有用)。
Split Animations
分割動(dòng)畫
If you have multiple animations in a single file, you can split it into multiple clips.
如果一個(gè)文件中有多個(gè)動(dòng)畫,可以用此功能將其分割為多個(gè)片段。
Name 名稱
The name of the split animation clip 分割得到的動(dòng)畫片段的名稱
Start 開始
The first frame of this clip in the model file在模型文件中,此片段的第一幀
End 結(jié)束
The last frame of this clip in the model file在模型文件中,此片段的最后一幀
WrapMode 循環(huán)模式
What the split clip does when the end of the animation is reached (this is identical to the wrap mode option described above).
動(dòng)畫片段播放結(jié)束時(shí)的行為(與前面提到的動(dòng)畫循環(huán)模式一樣)
Loop 循環(huán)
Depending on how the animation was created, one extra frame of animation may be required for the split clip to loop properly. If your looping animation doesn't look correct, try enabling this option.
根據(jù)不同的動(dòng)畫創(chuàng)建方法,分割片度可能需要額外的一幀動(dòng)畫來使其可以正確的循環(huán)。如果你的循環(huán)動(dòng)畫看起來不正確,嘗試啟用此選項(xiàng)
Animation Compression
動(dòng)畫壓縮
Anim. Compression
動(dòng)畫壓縮
The type of compression that will be applied to this mesh's animation(s)
用什么類型的壓縮方法來壓縮此網(wǎng)格的動(dòng)畫
Off 關(guān)閉
Disables animation compression. This means that Unity doesn't reduce keyframe count on import, which leads to the highest precision animations, but slower performance and bigger file and runtime memory size. It is generally not advisable to use this option - if you need higher precision animation, you should enable keyframe reduction and lower allowed Animation Compression Error values instead.
禁用動(dòng)畫壓縮。這意味著,Unity不會(huì)減少導(dǎo)入關(guān)鍵幀的數(shù)量,此模式導(dǎo)入的動(dòng)畫精度最高,但會(huì)帶來較慢的速度性能,較大的文件和運(yùn)行時(shí)內(nèi)存大小。一般而言,不推薦使用這個(gè)選項(xiàng) - 如果你需要更高精度的動(dòng)畫,您應(yīng)該啟用關(guān)鍵幀減少模式(keyframe reduction)并降低允許動(dòng)畫壓縮誤差值(Animation Compression Error)。
Keyframe Reduction 關(guān)鍵幀減少
Reduces keyframes on import. If selected, the Animation Compression Errors options are displayed.
導(dǎo)入時(shí)減少關(guān)鍵幀。選用此模式會(huì)顯示動(dòng)畫壓縮誤差(Animation Compression Error)選項(xiàng)
Keyframe Reduction and
Compression
關(guān)鍵幀減少并壓縮
Reduces keyframes on import and compresses keyframes when storing animations in files. This affects only file size - the runtime memory size is the same as Keyframe Reduction. If selected, the Animation Compression Errors options are displayed.
導(dǎo)入時(shí)減少關(guān)鍵幀并在存儲(chǔ)文件時(shí)壓縮關(guān)鍵幀。此模式只會(huì)影響文件大小 – 運(yùn)行時(shí)內(nèi)存大小與使用關(guān)鍵幀減小模式時(shí)相同。選用此模式會(huì)顯示動(dòng)畫壓縮誤差(Animation Compression Error)選項(xiàng)
Animation Compression Errors
動(dòng)畫壓縮誤差
These options are available only when keyframe reduction is enabled.
這些選項(xiàng)僅當(dāng)啟用減少關(guān)鍵幀時(shí)可用。
Rotation Error 旋轉(zhuǎn)誤差
Defines how much rotation curves should be reduced. The smaller value you use - the higher precision you get.
定義應(yīng)減少多少旋轉(zhuǎn)曲線。值越小,精度越高
Position Error 位置誤差
Defines how much position curves should be reduced. The smaller value you use - the higher precision you get.
定義應(yīng)減少多少位置曲線。值越小,精度越高
Scale Error 縮放誤差
Defines how much scale curves should be reduced. The smaller value you use - the higher precision you get.
定義應(yīng)減少多少縮放曲線。值越小,精度越高
If material generation is disabled (i.e. Import Materials is unchecked), then it will assign the Default-Diffuse material. If it is enabled then it will do the following:
如果禁用了材質(zhì)生成(即禁用了導(dǎo)入材質(zhì)選項(xiàng)),所有的材質(zhì)都被賦為默認(rèn)的漫反射材質(zhì)。如果啟用了材質(zhì)生成,那么將按照以下的規(guī)則對材質(zhì)進(jìn)行賦值:
Unity有兩種類型的碰撞體:網(wǎng)格碰撞體(Mesh Colliders)和原始碰撞體(Primitive Colliders)。網(wǎng)格碰撞體組件使用導(dǎo)入的網(wǎng)格數(shù)據(jù),可用于環(huán)境碰撞。如果在導(dǎo)入設(shè)置中啟用了生成碰撞體(Generate Colliders)選項(xiàng),在網(wǎng)格添加到場景中時(shí)會(huì)自動(dòng)為其添加網(wǎng)格碰撞體。物理系統(tǒng)將網(wǎng)格碰撞體視為固體。
If you are moving the object around (a car for example), you can not use Mesh colliders. Instead, you will have to use Primitive colliders. In this case you should disable the Generate Colliders setting.
Animations are automatically imported from the scene. For more details about animation import options see the Animation Import chapter.
動(dòng)畫從場景中自動(dòng)導(dǎo)入。有關(guān)動(dòng)畫導(dǎo)入選項(xiàng)的更多細(xì)節(jié),請參閱動(dòng)畫導(dǎo)入章節(jié)。
If you have a character with a normal map that was generated from a high-polygon version of the model, you should import the game-quality version with a Smoothing angle of 180 degrees. This will prevent odd-looking seams in lighting due to tangent splitting. If the seams are still present with these settings, enable Split tangents across UV seams.
如果你有一個(gè)從高精度多邊形版本生成的帶法線貼圖的角色,你應(yīng)該以180度的平滑角度(Smoothing angel)導(dǎo)入此角色的游戲質(zhì)量版本。這將防止由于切線切割在光照中產(chǎn)生的奇怪的接縫。如果在應(yīng)用了這些設(shè)置后仍然存在接縫,啟用在UV接縫處分割切線選項(xiàng)(Split tangents across UV seams)。
If you are converting a greyscale image into a normal map, you don't need to worry about this.
This is correct. What you are looking at is the number of triangles actually being sent to OpenGLES for rendering. In addition to the case where the material requires them to be sent twice, other things like hard-normals and non-contiguous UVs increase vertex/triangle counts significantly compared to what a modeling app or Unity tells you. Triangles need to be contiguous in both 3D and UV space to form a strip, so when you have UV seams, degenerate triangles have to be made to form strips - this bumps up the count. Previously Unity would report triangle counts incorrectly. This was fixed first in the run-time, and recently in the Editor. Now both will report the correct number of triangles actually being sent to OpenGLES for rendering.
這是正確的。你看到的是實(shí)際被發(fā)送到OpenGLES渲染的三角形數(shù)目。除了有的材質(zhì)需要將三角形發(fā)送兩次的情況下,其他事情,如硬法線和非連續(xù)的UV,顯著地增加了頂點(diǎn)/三角形數(shù)量,相比起建模軟件或者Unity告訴你的。三角形需要連續(xù)的3D和UV空間才能形成一個(gè)strip,所以當(dāng)模型中有UV接縫時(shí),需要?jiǎng)?chuàng)建退化的三角形來形成strip - 這會(huì)增加三角形的數(shù)量。以前版本的Unity會(huì)報(bào)告三角形計(jì)數(shù)不正確。這首先在運(yùn)行時(shí)被修正,最近在編輯器中也被修正了,F(xiàn)在,運(yùn)行時(shí)和編輯器都能報(bào)告實(shí)際上被送到OpenGLES渲染的三角形的正確數(shù)目。