Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
ResourceImporterScene
繼承: ResourceImporter < RefCounted < Object
Imports a glTF, FBX, COLLADA, or Blender 3D scene.
說明
See also ResourceImporterOBJ, which is used for OBJ models that can be imported as an independent Mesh or a scene.
Additional options (such as extracting individual meshes or materials to files) are available in the Advanced Import Settings dialog. This dialog can be accessed by double-clicking a 3D scene in the FileSystem dock or by selecting a 3D scene in the FileSystem dock, going to the Import dock and choosing Advanced.
Note: ResourceImporterScene is not used for PackedScenes, such as .tscn and .scn files.
教學
屬性
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
屬性說明
Dictionary _subresources = {} 🔗
包含場景子資源的屬性。這是一個內部選項,在匯入塢中不可見。
用於透過線性內插將動畫曲線烘焙為一系列點的每秒影格數。建議配置此值以配對您用作基線的值您的3D 建模軟體。較高的值會導致更精確的動畫和快速的運動變化,但代價是檔案大小和記憶體使用量更大。由於插值,超過30 FPS 通常沒有太大好處(因為動畫仍然會出現)在較高算繪影格速率下平滑)。
bool animation/import = true 🔗
如果為 true,則馬達將轉動鉸鏈。
bool animation/import_rest_as_RESET = false 🔗
If true, adds an Animation named RESET, containing the Skeleton3D.get_bone_rest() from Skeleton3D nodes. This can be useful to extract an animation in the reference pose.
bool animation/remove_immutable_tracks = true 🔗
如果true,則刪除僅包含預設值的動畫軌跡。這可以減少某些3D 場景的輸出檔案大小和記憶體使用量,具體取決於其內容動畫軌道。
bool animation/trimming = false 🔗
如果true,如果沒有關鍵影格更改,則修剪動畫的開頭和結尾。這可以減少某些3D 場景的輸出檔案大小和記憶體使用量,取決於關於他們的動畫軌道的內容。
bool array_mesh/deduplicate_surfaces = true 🔗
If the 3D model file contains only one mesh, this option has no effect. If true and the 3D model file contains multiple meshes with the same surface names and formats, the surfaces will be merged together when the meshes are merged. This is useful for reducing the number of surfaces in the resulting mesh, and avoids duplicating materials. If false and the 3D model file contains multiple meshes, the surfaces will always be kept separate.
String import_script/path = "" 🔗
Path to an import script, which can run code after the import process has completed for custom processing. See Using import scripts for automation for more information.
Material extraction mode.
0 (Keep Internal), materials are not extracted.1 (Extract Once), materials are extracted once and reused on subsequent import.2 (Extract and Overwrite), materials are extracted and overwritten on every import.
int materials/extract_format = 0 🔗
Extracted material file format.
0 (Text), text file format (*.tres).1 (Binary), binary file format (*.res).2 (Material), binary file format (*.material).
String materials/extract_path = "" 🔗
Path extracted materials are saved to. If empty, source scene path is used.
bool mesh_library/use_node_names_as_mesh_names = false 🔗
If true, the mesh names will be set to the names of the nodes in the 3D model file. If false, the mesh names will be set to the names of the meshes in the 3D model file. Enabling this is a common work-around when the author of the 3D model file did not properly set the mesh names in Blender or other 3D modeling apps. For example, a file may have a node named "Turret" with a mesh named "Cube.002", so enabling this option will set the mesh name to "Turret" instead of "Cube_002".
bool meshes/create_shadow_meshes = true 🔗
如果true,則在匯入時啟用陰影網格的產生。這可以最佳化陰影算繪,而不會在可能的情況下透過將頂點焊接在一起來降低品質。這反過來又減少了記憶體算繪陰影所需的頻寬。陰影網格產生目前不支援使用比來源網格更低的細節等級(但陰影算繪將在相關時使用LOD)。
bool meshes/ensure_tangents = true 🔗
If true, generate vertex tangents using Mikktspace if the input meshes don't have tangent data. When possible, it's recommended to let the 3D modeling software generate tangents on export instead of relying on this option. Tangents are required for correct display of normal and height maps, along with any material/shader features that require tangents.
If you don't need material features that require tangents, disabling this can reduce output file size and speed up importing if the source 3D file doesn't contain tangents.
bool meshes/force_disable_compression = false 🔗
If true, mesh compression will not be used. Consider enabling if you notice blocky artifacts in your mesh normals or UVs, or if you have meshes that are larger than a few thousand meters in each direction.
bool meshes/generate_lods = true 🔗
如果true,則產生網格的較低細節變體,這些變體將顯示在遠處以提高算繪效能。並非所有網格都受益於LOD,特別是如果它們永遠不會從遠處算繪。停用此功能可以減少輸出檔案大小並加快匯入速度。請參閱網格細節等級(LOD) 了解更多。
在3D場景中設定網格體的GeometryInstance3D.gi_mode。如果設定為靜態光照貼圖,則將網格體的GI模式設定為靜態並產生UV2匯入 LightmapGI 烘焙時。
float meshes/lightmap_texel_size = 0.2 🔗
控制烘焙光照貼圖上每個紋素的大小。較小的值會導致更精確的光照貼圖,但代價是更大的光照貼圖大小和更長的烘焙時間。
注意:僅當meshes/light_baking設定為靜態光照貼圖時有效。
bool nodes/apply_root_scale = true 🔗
如果true,nodes/root_scale將套用於後代節點、網格、動畫、骨骼等。這表示如果您新增稍後在匯入的場景中新增子節點時,它將不會縮放。如果false,nodes/root_scale 將乘以根節點的縮放比例。
bool nodes/import_as_skeleton_bones = false 🔗
Treat all nodes in the imported scene as if they are bones within a single Skeleton3D. Can be used to guarantee that imported animations target skeleton bones rather than nodes. May also be used to assign the "Root" bone in a BoneMap. See Retargeting 3D Skeletons for more information.
覆寫根節點名稱。如果為空,則根節點將使用場景指定的名稱,如果場景未指定根名稱,則使用檔案名稱。
float nodes/root_scale = 1.0 🔗
用於場景根的均勻比例。1.0的預設值將不會執行任何重新縮放。有關如何執行的詳細信息,請參閱nodes/apply_root_scale套用此比例。
Script nodes/root_script = null 🔗
If set to a valid script, attaches the script to the root node of the imported scene. If the type of the root node is not compatible with the script, the root node will be replaced with a type that is compatible with the script. This setting can also be used on other non-mesh nodes in the scene to attach scripts to them.
覆寫根節點型別。如果為空,則根節點將使用場景指定的內容,如果場景未指定根型別,則根節點將使用 Node3D。使用下列節點型別建議繼承自Node3D。否則,您將無法在3D 編輯器中直接定位節點。
bool nodes/use_name_suffixes = true 🔗
If true, will use suffixes in the names of imported objects such as nodes and resources to determine types and properties, such as -noimp to skip import of a node or animation, -alpha to enable alpha transparency on a material, and -vcol to enable vertex colors on a material. Disabling this makes editor-imported files more similar to the original files, and more similar to files imported at runtime. See Node type customization using name suffixes for more information.
bool nodes/use_node_type_suffixes = true 🔗
If true, will use suffixes in the node names to determine the node type, such as -col for collision shapes. This is only used when nodes/use_name_suffixes is true. Disabling this makes editor-imported files more similar to the original files, and more similar to files imported at runtime. See Node type customization using name suffixes for more information.
bool skins/use_named_skins = true 🔗
If checked, use named Skins for animation. The MeshInstance3D node contains 3 properties of relevance here: a skeleton NodePath pointing to the Skeleton3D node (usually ..), a mesh, and a skin:
The Skeleton3D node contains a list of bones with names, their pose and rest, a name, and a parent bone.
The mesh is all of the raw vertex data needed to display a mesh. In terms of the mesh, it knows how vertices are weight-painted and uses some internal numbering often imported from 3D modeling software.
The skin contains the information necessary to bind this mesh onto this Skeleton3D. For each of the internal bone IDs chosen by the 3D modeling software, it contains two things. Firstly, a matrix known as the Bind Pose Matrix, Inverse Bind Matrix, or IBM for short. Secondly, the Skin contains each bone's name (if skins/use_named_skins is
true), or the bone's index within the Skeleton3D list (if skins/use_named_skins isfalse).
Together, this information is enough to tell Godot how to use the bone poses in the Skeleton3D node to render the mesh from each MeshInstance3D. Note that each MeshInstance3D may share binds, as is common in models exported from Blender, or each MeshInstance3D may use a separate Skin object, as is common in models exported from other tools such as Maya.