class_resourceimporterscene.rst 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/ResourceImporterScene.xml.
  6. .. _class_ResourceImporterScene:
  7. ResourceImporterScene
  8. =====================
  9. **Inherits:** :ref:`ResourceImporter<class_ResourceImporter>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. Imports a glTF, FBX, Collada or Blender 3D scene.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. See also :ref:`ResourceImporterOBJ<class_ResourceImporterOBJ>`, which is used for OBJ models that can be imported as an independent :ref:`Mesh<class_Mesh>` or a scene.
  15. 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**.
  16. \ **Note:** **ResourceImporterScene** is *not* used for :ref:`PackedScene<class_PackedScene>`\ s, such as ``.tscn`` and ``.scn`` files.
  17. .. rst-class:: classref-introduction-group
  18. Tutorials
  19. ---------
  20. - :doc:`Importing 3D scenes <../tutorials/assets_pipeline/importing_3d_scenes/index>`
  21. .. rst-class:: classref-reftable-group
  22. Properties
  23. ----------
  24. .. table::
  25. :widths: auto
  26. +-------------------------------------+------------------------------------------------------------------------------------------------------------------+-----------+
  27. | :ref:`Dictionary<class_Dictionary>` | :ref:`_subresources<class_ResourceImporterScene_property__subresources>` | ``{}`` |
  28. +-------------------------------------+------------------------------------------------------------------------------------------------------------------+-----------+
  29. | :ref:`float<class_float>` | :ref:`animation/fps<class_ResourceImporterScene_property_animation/fps>` | ``30`` |
  30. +-------------------------------------+------------------------------------------------------------------------------------------------------------------+-----------+
  31. | :ref:`bool<class_bool>` | :ref:`animation/import<class_ResourceImporterScene_property_animation/import>` | ``true`` |
  32. +-------------------------------------+------------------------------------------------------------------------------------------------------------------+-----------+
  33. | :ref:`bool<class_bool>` | :ref:`animation/import_rest_as_RESET<class_ResourceImporterScene_property_animation/import_rest_as_RESET>` | ``false`` |
  34. +-------------------------------------+------------------------------------------------------------------------------------------------------------------+-----------+
  35. | :ref:`bool<class_bool>` | :ref:`animation/remove_immutable_tracks<class_ResourceImporterScene_property_animation/remove_immutable_tracks>` | ``true`` |
  36. +-------------------------------------+------------------------------------------------------------------------------------------------------------------+-----------+
  37. | :ref:`bool<class_bool>` | :ref:`animation/trimming<class_ResourceImporterScene_property_animation/trimming>` | ``false`` |
  38. +-------------------------------------+------------------------------------------------------------------------------------------------------------------+-----------+
  39. | :ref:`String<class_String>` | :ref:`import_script/path<class_ResourceImporterScene_property_import_script/path>` | ``""`` |
  40. +-------------------------------------+------------------------------------------------------------------------------------------------------------------+-----------+
  41. | :ref:`bool<class_bool>` | :ref:`meshes/create_shadow_meshes<class_ResourceImporterScene_property_meshes/create_shadow_meshes>` | ``true`` |
  42. +-------------------------------------+------------------------------------------------------------------------------------------------------------------+-----------+
  43. | :ref:`bool<class_bool>` | :ref:`meshes/ensure_tangents<class_ResourceImporterScene_property_meshes/ensure_tangents>` | ``true`` |
  44. +-------------------------------------+------------------------------------------------------------------------------------------------------------------+-----------+
  45. | :ref:`bool<class_bool>` | :ref:`meshes/force_disable_compression<class_ResourceImporterScene_property_meshes/force_disable_compression>` | ``false`` |
  46. +-------------------------------------+------------------------------------------------------------------------------------------------------------------+-----------+
  47. | :ref:`bool<class_bool>` | :ref:`meshes/generate_lods<class_ResourceImporterScene_property_meshes/generate_lods>` | ``true`` |
  48. +-------------------------------------+------------------------------------------------------------------------------------------------------------------+-----------+
  49. | :ref:`int<class_int>` | :ref:`meshes/light_baking<class_ResourceImporterScene_property_meshes/light_baking>` | ``1`` |
  50. +-------------------------------------+------------------------------------------------------------------------------------------------------------------+-----------+
  51. | :ref:`float<class_float>` | :ref:`meshes/lightmap_texel_size<class_ResourceImporterScene_property_meshes/lightmap_texel_size>` | ``0.2`` |
  52. +-------------------------------------+------------------------------------------------------------------------------------------------------------------+-----------+
  53. | :ref:`bool<class_bool>` | :ref:`nodes/apply_root_scale<class_ResourceImporterScene_property_nodes/apply_root_scale>` | ``true`` |
  54. +-------------------------------------+------------------------------------------------------------------------------------------------------------------+-----------+
  55. | :ref:`bool<class_bool>` | :ref:`nodes/import_as_skeleton_bones<class_ResourceImporterScene_property_nodes/import_as_skeleton_bones>` | ``false`` |
  56. +-------------------------------------+------------------------------------------------------------------------------------------------------------------+-----------+
  57. | :ref:`String<class_String>` | :ref:`nodes/root_name<class_ResourceImporterScene_property_nodes/root_name>` | ``""`` |
  58. +-------------------------------------+------------------------------------------------------------------------------------------------------------------+-----------+
  59. | :ref:`float<class_float>` | :ref:`nodes/root_scale<class_ResourceImporterScene_property_nodes/root_scale>` | ``1.0`` |
  60. +-------------------------------------+------------------------------------------------------------------------------------------------------------------+-----------+
  61. | :ref:`String<class_String>` | :ref:`nodes/root_type<class_ResourceImporterScene_property_nodes/root_type>` | ``""`` |
  62. +-------------------------------------+------------------------------------------------------------------------------------------------------------------+-----------+
  63. | :ref:`bool<class_bool>` | :ref:`nodes/use_node_type_suffixes<class_ResourceImporterScene_property_nodes/use_node_type_suffixes>` | ``true`` |
  64. +-------------------------------------+------------------------------------------------------------------------------------------------------------------+-----------+
  65. | :ref:`bool<class_bool>` | :ref:`skins/use_named_skins<class_ResourceImporterScene_property_skins/use_named_skins>` | ``true`` |
  66. +-------------------------------------+------------------------------------------------------------------------------------------------------------------+-----------+
  67. .. rst-class:: classref-section-separator
  68. ----
  69. .. rst-class:: classref-descriptions-group
  70. Property Descriptions
  71. ---------------------
  72. .. _class_ResourceImporterScene_property__subresources:
  73. .. rst-class:: classref-property
  74. :ref:`Dictionary<class_Dictionary>` **_subresources** = ``{}`` :ref:`🔗<class_ResourceImporterScene_property__subresources>`
  75. Contains properties for the scene's subresources. This is an internal option which is not visible in the Import dock.
  76. .. rst-class:: classref-item-separator
  77. ----
  78. .. _class_ResourceImporterScene_property_animation/fps:
  79. .. rst-class:: classref-property
  80. :ref:`float<class_float>` **animation/fps** = ``30`` :ref:`🔗<class_ResourceImporterScene_property_animation/fps>`
  81. The number of frames per second to use for baking animation curves to a series of points with linear interpolation. It's recommended to configure this value to match the value you're using as a baseline in your 3D modeling software. Higher values result in more precise animation with fast movement changes, at the cost of higher file sizes and memory usage. Thanks to interpolation, there is usually not much benefit in going above 30 FPS (as the animation will still appear smooth at higher rendering framerates).
  82. .. rst-class:: classref-item-separator
  83. ----
  84. .. _class_ResourceImporterScene_property_animation/import:
  85. .. rst-class:: classref-property
  86. :ref:`bool<class_bool>` **animation/import** = ``true`` :ref:`🔗<class_ResourceImporterScene_property_animation/import>`
  87. If ``true``, import animations from the 3D scene.
  88. .. rst-class:: classref-item-separator
  89. ----
  90. .. _class_ResourceImporterScene_property_animation/import_rest_as_RESET:
  91. .. rst-class:: classref-property
  92. :ref:`bool<class_bool>` **animation/import_rest_as_RESET** = ``false`` :ref:`🔗<class_ResourceImporterScene_property_animation/import_rest_as_RESET>`
  93. If ``true``, adds an :ref:`Animation<class_Animation>` named ``RESET``, containing the :ref:`Skeleton3D.get_bone_rest<class_Skeleton3D_method_get_bone_rest>` from :ref:`Skeleton3D<class_Skeleton3D>` nodes. This can be useful to extract an animation in the reference pose.
  94. .. rst-class:: classref-item-separator
  95. ----
  96. .. _class_ResourceImporterScene_property_animation/remove_immutable_tracks:
  97. .. rst-class:: classref-property
  98. :ref:`bool<class_bool>` **animation/remove_immutable_tracks** = ``true`` :ref:`🔗<class_ResourceImporterScene_property_animation/remove_immutable_tracks>`
  99. If ``true``, remove animation tracks that only contain default values. This can reduce output file size and memory usage with certain 3D scenes, depending on the contents of their animation tracks.
  100. .. rst-class:: classref-item-separator
  101. ----
  102. .. _class_ResourceImporterScene_property_animation/trimming:
  103. .. rst-class:: classref-property
  104. :ref:`bool<class_bool>` **animation/trimming** = ``false`` :ref:`🔗<class_ResourceImporterScene_property_animation/trimming>`
  105. If ``true``, trim the beginning and end of animations if there are no keyframe changes. This can reduce output file size and memory usage with certain 3D scenes, depending on the contents of their animation tracks.
  106. .. rst-class:: classref-item-separator
  107. ----
  108. .. _class_ResourceImporterScene_property_import_script/path:
  109. .. rst-class:: classref-property
  110. :ref:`String<class_String>` **import_script/path** = ``""`` :ref:`🔗<class_ResourceImporterScene_property_import_script/path>`
  111. Path to an import script, which can run code after the import process has completed for custom processing. See `Using import scripts for automation <../tutorials/assets_pipeline/importing_3d_scenes/import_configuration.html#using-import-scripts-for-automation>`__ for more information.
  112. .. rst-class:: classref-item-separator
  113. ----
  114. .. _class_ResourceImporterScene_property_meshes/create_shadow_meshes:
  115. .. rst-class:: classref-property
  116. :ref:`bool<class_bool>` **meshes/create_shadow_meshes** = ``true`` :ref:`🔗<class_ResourceImporterScene_property_meshes/create_shadow_meshes>`
  117. If ``true``, enables the generation of shadow meshes on import. This optimizes shadow rendering without reducing quality by welding vertices together when possible. This in turn reduces the memory bandwidth required to render shadows. Shadow mesh generation currently doesn't support using a lower detail level than the source mesh (but shadow rendering will make use of LODs when relevant).
  118. .. rst-class:: classref-item-separator
  119. ----
  120. .. _class_ResourceImporterScene_property_meshes/ensure_tangents:
  121. .. rst-class:: classref-property
  122. :ref:`bool<class_bool>` **meshes/ensure_tangents** = ``true`` :ref:`🔗<class_ResourceImporterScene_property_meshes/ensure_tangents>`
  123. If ``true``, generate vertex tangents using `Mikktspace <http://www.mikktspace.com/>`__ 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 on relying on this option. Tangents are required for correct display of normal and height maps, along with any material/shader features that require tangents.
  124. 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.
  125. .. rst-class:: classref-item-separator
  126. ----
  127. .. _class_ResourceImporterScene_property_meshes/force_disable_compression:
  128. .. rst-class:: classref-property
  129. :ref:`bool<class_bool>` **meshes/force_disable_compression** = ``false`` :ref:`🔗<class_ResourceImporterScene_property_meshes/force_disable_compression>`
  130. 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.
  131. .. rst-class:: classref-item-separator
  132. ----
  133. .. _class_ResourceImporterScene_property_meshes/generate_lods:
  134. .. rst-class:: classref-property
  135. :ref:`bool<class_bool>` **meshes/generate_lods** = ``true`` :ref:`🔗<class_ResourceImporterScene_property_meshes/generate_lods>`
  136. If ``true``, generates lower detail variants of the mesh which will be displayed in the distance to improve rendering performance. Not all meshes benefit from LOD, especially if they are never rendered from far away. Disabling this can reduce output file size and speed up importing. See `Mesh level of detail (LOD) <../tutorials/3d/mesh_lod.html#doc-mesh-lod>`__ for more information.
  137. .. rst-class:: classref-item-separator
  138. ----
  139. .. _class_ResourceImporterScene_property_meshes/light_baking:
  140. .. rst-class:: classref-property
  141. :ref:`int<class_int>` **meshes/light_baking** = ``1`` :ref:`🔗<class_ResourceImporterScene_property_meshes/light_baking>`
  142. Configures the meshes' :ref:`GeometryInstance3D.gi_mode<class_GeometryInstance3D_property_gi_mode>` in the 3D scene. If set to **Static Lightmaps**, sets the meshes' GI mode to Static and generates UV2 on import for :ref:`LightmapGI<class_LightmapGI>` baking.
  143. .. rst-class:: classref-item-separator
  144. ----
  145. .. _class_ResourceImporterScene_property_meshes/lightmap_texel_size:
  146. .. rst-class:: classref-property
  147. :ref:`float<class_float>` **meshes/lightmap_texel_size** = ``0.2`` :ref:`🔗<class_ResourceImporterScene_property_meshes/lightmap_texel_size>`
  148. Controls the size of each texel on the baked lightmap. A smaller value results in more precise lightmaps, at the cost of larger lightmap sizes and longer bake times.
  149. \ **Note:** Only effective if :ref:`meshes/light_baking<class_ResourceImporterScene_property_meshes/light_baking>` is set to **Static Lightmaps**.
  150. .. rst-class:: classref-item-separator
  151. ----
  152. .. _class_ResourceImporterScene_property_nodes/apply_root_scale:
  153. .. rst-class:: classref-property
  154. :ref:`bool<class_bool>` **nodes/apply_root_scale** = ``true`` :ref:`🔗<class_ResourceImporterScene_property_nodes/apply_root_scale>`
  155. If ``true``, :ref:`nodes/root_scale<class_ResourceImporterScene_property_nodes/root_scale>` will be applied to the descendant nodes, meshes, animations, bones, etc. This means that if you add a child node later on within the imported scene, it won't be scaled. If ``false``, :ref:`nodes/root_scale<class_ResourceImporterScene_property_nodes/root_scale>` will multiply the scale of the root node instead.
  156. .. rst-class:: classref-item-separator
  157. ----
  158. .. _class_ResourceImporterScene_property_nodes/import_as_skeleton_bones:
  159. .. rst-class:: classref-property
  160. :ref:`bool<class_bool>` **nodes/import_as_skeleton_bones** = ``false`` :ref:`🔗<class_ResourceImporterScene_property_nodes/import_as_skeleton_bones>`
  161. Treat all nodes in the imported scene as if they are bones within a single :ref:`Skeleton3D<class_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 :ref:`BoneMap<class_BoneMap>`. See :doc:`Retargeting 3D Skeletons <../tutorials/assets_pipeline/retargeting_3d_skeletons>` for more information.
  162. .. rst-class:: classref-item-separator
  163. ----
  164. .. _class_ResourceImporterScene_property_nodes/root_name:
  165. .. rst-class:: classref-property
  166. :ref:`String<class_String>` **nodes/root_name** = ``""`` :ref:`🔗<class_ResourceImporterScene_property_nodes/root_name>`
  167. Override for the root node name. If empty, the root node will use what the scene specifies, or the file name if the scene does not specify a root name.
  168. .. rst-class:: classref-item-separator
  169. ----
  170. .. _class_ResourceImporterScene_property_nodes/root_scale:
  171. .. rst-class:: classref-property
  172. :ref:`float<class_float>` **nodes/root_scale** = ``1.0`` :ref:`🔗<class_ResourceImporterScene_property_nodes/root_scale>`
  173. The uniform scale to use for the scene root. The default value of ``1.0`` will not perform any rescaling. See :ref:`nodes/apply_root_scale<class_ResourceImporterScene_property_nodes/apply_root_scale>` for details of how this scale is applied.
  174. .. rst-class:: classref-item-separator
  175. ----
  176. .. _class_ResourceImporterScene_property_nodes/root_type:
  177. .. rst-class:: classref-property
  178. :ref:`String<class_String>` **nodes/root_type** = ``""`` :ref:`🔗<class_ResourceImporterScene_property_nodes/root_type>`
  179. Override for the root node type. If empty, the root node will use what the scene specifies, or :ref:`Node3D<class_Node3D>` if the scene does not specify a root type. Using a node type that inherits from :ref:`Node3D<class_Node3D>` is recommended. Otherwise, you'll lose the ability to position the node directly in the 3D editor.
  180. .. rst-class:: classref-item-separator
  181. ----
  182. .. _class_ResourceImporterScene_property_nodes/use_node_type_suffixes:
  183. .. rst-class:: classref-property
  184. :ref:`bool<class_bool>` **nodes/use_node_type_suffixes** = ``true`` :ref:`🔗<class_ResourceImporterScene_property_nodes/use_node_type_suffixes>`
  185. If ``true``, use suffixes in the node names to determine the node type, such as ``-col`` for collision shapes. Disabling this makes editor-imported files more similar to the original files, and more similar to importing files at runtime. See :doc:`Node type customization using name suffixes <../tutorials/assets_pipeline/importing_3d_scenes/node_type_customization>` for more information.
  186. .. rst-class:: classref-item-separator
  187. ----
  188. .. _class_ResourceImporterScene_property_skins/use_named_skins:
  189. .. rst-class:: classref-property
  190. :ref:`bool<class_bool>` **skins/use_named_skins** = ``true`` :ref:`🔗<class_ResourceImporterScene_property_skins/use_named_skins>`
  191. If checked, use named :ref:`Skin<class_Skin>`\ s for animation. The :ref:`MeshInstance3D<class_MeshInstance3D>` node contains 3 properties of relevance here: a skeleton :ref:`NodePath<class_NodePath>` pointing to the :ref:`Skeleton3D<class_Skeleton3D>` node (usually ``..``), a mesh, and a skin:
  192. - The :ref:`Skeleton3D<class_Skeleton3D>` node contains a list of bones with names, their pose and rest, a name and a parent bone.
  193. - 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.
  194. - The skin contains the information necessary to bind this mesh onto this Skeleton3D. For every one 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 :ref:`Skin<class_Skin>` contains each bone's name (if :ref:`skins/use_named_skins<class_ResourceImporterScene_property_skins/use_named_skins>` is ``true``), or the bone's index within the :ref:`Skeleton3D<class_Skeleton3D>` list (if :ref:`skins/use_named_skins<class_ResourceImporterScene_property_skins/use_named_skins>` is ``false``).
  195. Together, this information is enough to tell Godot how to use the bone poses in the :ref:`Skeleton3D<class_Skeleton3D>` node to render the mesh from each :ref:`MeshInstance3D<class_MeshInstance3D>`. Note that each :ref:`MeshInstance3D<class_MeshInstance3D>` may share binds, as is common in models exported from Blender, or each :ref:`MeshInstance3D<class_MeshInstance3D>` may use a separate :ref:`Skin<class_Skin>` object, as is common in models exported from other tools such as Maya.
  196. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  197. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  198. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  199. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  200. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  201. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  202. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  203. .. |void| replace:: :abbr:`void (No return value.)`