123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350 |
- :github_url: hide
- .. DO NOT EDIT THIS FILE!!!
- .. Generated automatically from Godot engine sources.
- .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
- .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/ResourceImporterScene.xml.
- .. _class_ResourceImporterScene:
- ResourceImporterScene
- =====================
- **Inherits:** :ref:`ResourceImporter<class_ResourceImporter>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
- Imports a glTF, FBX, Collada or Blender 3D scene.
- .. rst-class:: classref-introduction-group
- Description
- -----------
- 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.
- 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 :ref:`PackedScene<class_PackedScene>`\ s, such as ``.tscn`` and ``.scn`` files.
- .. rst-class:: classref-introduction-group
- Tutorials
- ---------
- - :doc:`Importing 3D scenes <../tutorials/assets_pipeline/importing_3d_scenes/index>`
- .. rst-class:: classref-reftable-group
- Properties
- ----------
- .. table::
- :widths: auto
- +-------------------------------------+------------------------------------------------------------------------------------------------------------------+-----------+
- | :ref:`Dictionary<class_Dictionary>` | :ref:`_subresources<class_ResourceImporterScene_property__subresources>` | ``{}`` |
- +-------------------------------------+------------------------------------------------------------------------------------------------------------------+-----------+
- | :ref:`float<class_float>` | :ref:`animation/fps<class_ResourceImporterScene_property_animation/fps>` | ``30`` |
- +-------------------------------------+------------------------------------------------------------------------------------------------------------------+-----------+
- | :ref:`bool<class_bool>` | :ref:`animation/import<class_ResourceImporterScene_property_animation/import>` | ``true`` |
- +-------------------------------------+------------------------------------------------------------------------------------------------------------------+-----------+
- | :ref:`bool<class_bool>` | :ref:`animation/import_rest_as_RESET<class_ResourceImporterScene_property_animation/import_rest_as_RESET>` | ``false`` |
- +-------------------------------------+------------------------------------------------------------------------------------------------------------------+-----------+
- | :ref:`bool<class_bool>` | :ref:`animation/remove_immutable_tracks<class_ResourceImporterScene_property_animation/remove_immutable_tracks>` | ``true`` |
- +-------------------------------------+------------------------------------------------------------------------------------------------------------------+-----------+
- | :ref:`bool<class_bool>` | :ref:`animation/trimming<class_ResourceImporterScene_property_animation/trimming>` | ``false`` |
- +-------------------------------------+------------------------------------------------------------------------------------------------------------------+-----------+
- | :ref:`String<class_String>` | :ref:`import_script/path<class_ResourceImporterScene_property_import_script/path>` | ``""`` |
- +-------------------------------------+------------------------------------------------------------------------------------------------------------------+-----------+
- | :ref:`bool<class_bool>` | :ref:`meshes/create_shadow_meshes<class_ResourceImporterScene_property_meshes/create_shadow_meshes>` | ``true`` |
- +-------------------------------------+------------------------------------------------------------------------------------------------------------------+-----------+
- | :ref:`bool<class_bool>` | :ref:`meshes/ensure_tangents<class_ResourceImporterScene_property_meshes/ensure_tangents>` | ``true`` |
- +-------------------------------------+------------------------------------------------------------------------------------------------------------------+-----------+
- | :ref:`bool<class_bool>` | :ref:`meshes/force_disable_compression<class_ResourceImporterScene_property_meshes/force_disable_compression>` | ``false`` |
- +-------------------------------------+------------------------------------------------------------------------------------------------------------------+-----------+
- | :ref:`bool<class_bool>` | :ref:`meshes/generate_lods<class_ResourceImporterScene_property_meshes/generate_lods>` | ``true`` |
- +-------------------------------------+------------------------------------------------------------------------------------------------------------------+-----------+
- | :ref:`int<class_int>` | :ref:`meshes/light_baking<class_ResourceImporterScene_property_meshes/light_baking>` | ``1`` |
- +-------------------------------------+------------------------------------------------------------------------------------------------------------------+-----------+
- | :ref:`float<class_float>` | :ref:`meshes/lightmap_texel_size<class_ResourceImporterScene_property_meshes/lightmap_texel_size>` | ``0.2`` |
- +-------------------------------------+------------------------------------------------------------------------------------------------------------------+-----------+
- | :ref:`bool<class_bool>` | :ref:`nodes/apply_root_scale<class_ResourceImporterScene_property_nodes/apply_root_scale>` | ``true`` |
- +-------------------------------------+------------------------------------------------------------------------------------------------------------------+-----------+
- | :ref:`bool<class_bool>` | :ref:`nodes/import_as_skeleton_bones<class_ResourceImporterScene_property_nodes/import_as_skeleton_bones>` | ``false`` |
- +-------------------------------------+------------------------------------------------------------------------------------------------------------------+-----------+
- | :ref:`String<class_String>` | :ref:`nodes/root_name<class_ResourceImporterScene_property_nodes/root_name>` | ``""`` |
- +-------------------------------------+------------------------------------------------------------------------------------------------------------------+-----------+
- | :ref:`float<class_float>` | :ref:`nodes/root_scale<class_ResourceImporterScene_property_nodes/root_scale>` | ``1.0`` |
- +-------------------------------------+------------------------------------------------------------------------------------------------------------------+-----------+
- | :ref:`String<class_String>` | :ref:`nodes/root_type<class_ResourceImporterScene_property_nodes/root_type>` | ``""`` |
- +-------------------------------------+------------------------------------------------------------------------------------------------------------------+-----------+
- | :ref:`bool<class_bool>` | :ref:`nodes/use_node_type_suffixes<class_ResourceImporterScene_property_nodes/use_node_type_suffixes>` | ``true`` |
- +-------------------------------------+------------------------------------------------------------------------------------------------------------------+-----------+
- | :ref:`bool<class_bool>` | :ref:`skins/use_named_skins<class_ResourceImporterScene_property_skins/use_named_skins>` | ``true`` |
- +-------------------------------------+------------------------------------------------------------------------------------------------------------------+-----------+
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Property Descriptions
- ---------------------
- .. _class_ResourceImporterScene_property__subresources:
- .. rst-class:: classref-property
- :ref:`Dictionary<class_Dictionary>` **_subresources** = ``{}`` :ref:`🔗<class_ResourceImporterScene_property__subresources>`
- Contains properties for the scene's subresources. This is an internal option which is not visible in the Import dock.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ResourceImporterScene_property_animation/fps:
- .. rst-class:: classref-property
- :ref:`float<class_float>` **animation/fps** = ``30`` :ref:`🔗<class_ResourceImporterScene_property_animation/fps>`
- 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).
- .. rst-class:: classref-item-separator
- ----
- .. _class_ResourceImporterScene_property_animation/import:
- .. rst-class:: classref-property
- :ref:`bool<class_bool>` **animation/import** = ``true`` :ref:`🔗<class_ResourceImporterScene_property_animation/import>`
- If ``true``, import animations from the 3D scene.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ResourceImporterScene_property_animation/import_rest_as_RESET:
- .. rst-class:: classref-property
- :ref:`bool<class_bool>` **animation/import_rest_as_RESET** = ``false`` :ref:`🔗<class_ResourceImporterScene_property_animation/import_rest_as_RESET>`
- 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.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ResourceImporterScene_property_animation/remove_immutable_tracks:
- .. rst-class:: classref-property
- :ref:`bool<class_bool>` **animation/remove_immutable_tracks** = ``true`` :ref:`🔗<class_ResourceImporterScene_property_animation/remove_immutable_tracks>`
- 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.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ResourceImporterScene_property_animation/trimming:
- .. rst-class:: classref-property
- :ref:`bool<class_bool>` **animation/trimming** = ``false`` :ref:`🔗<class_ResourceImporterScene_property_animation/trimming>`
- 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.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ResourceImporterScene_property_import_script/path:
- .. rst-class:: classref-property
- :ref:`String<class_String>` **import_script/path** = ``""`` :ref:`🔗<class_ResourceImporterScene_property_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 <../tutorials/assets_pipeline/importing_3d_scenes/import_configuration.html#using-import-scripts-for-automation>`__ for more information.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ResourceImporterScene_property_meshes/create_shadow_meshes:
- .. rst-class:: classref-property
- :ref:`bool<class_bool>` **meshes/create_shadow_meshes** = ``true`` :ref:`🔗<class_ResourceImporterScene_property_meshes/create_shadow_meshes>`
- 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).
- .. rst-class:: classref-item-separator
- ----
- .. _class_ResourceImporterScene_property_meshes/ensure_tangents:
- .. rst-class:: classref-property
- :ref:`bool<class_bool>` **meshes/ensure_tangents** = ``true`` :ref:`🔗<class_ResourceImporterScene_property_meshes/ensure_tangents>`
- 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.
- 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.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ResourceImporterScene_property_meshes/force_disable_compression:
- .. rst-class:: classref-property
- :ref:`bool<class_bool>` **meshes/force_disable_compression** = ``false`` :ref:`🔗<class_ResourceImporterScene_property_meshes/force_disable_compression>`
- 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.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ResourceImporterScene_property_meshes/generate_lods:
- .. rst-class:: classref-property
- :ref:`bool<class_bool>` **meshes/generate_lods** = ``true`` :ref:`🔗<class_ResourceImporterScene_property_meshes/generate_lods>`
- 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.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ResourceImporterScene_property_meshes/light_baking:
- .. rst-class:: classref-property
- :ref:`int<class_int>` **meshes/light_baking** = ``1`` :ref:`🔗<class_ResourceImporterScene_property_meshes/light_baking>`
- 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.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ResourceImporterScene_property_meshes/lightmap_texel_size:
- .. rst-class:: classref-property
- :ref:`float<class_float>` **meshes/lightmap_texel_size** = ``0.2`` :ref:`🔗<class_ResourceImporterScene_property_meshes/lightmap_texel_size>`
- 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.
- \ **Note:** Only effective if :ref:`meshes/light_baking<class_ResourceImporterScene_property_meshes/light_baking>` is set to **Static Lightmaps**.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ResourceImporterScene_property_nodes/apply_root_scale:
- .. rst-class:: classref-property
- :ref:`bool<class_bool>` **nodes/apply_root_scale** = ``true`` :ref:`🔗<class_ResourceImporterScene_property_nodes/apply_root_scale>`
- 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.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ResourceImporterScene_property_nodes/import_as_skeleton_bones:
- .. rst-class:: classref-property
- :ref:`bool<class_bool>` **nodes/import_as_skeleton_bones** = ``false`` :ref:`🔗<class_ResourceImporterScene_property_nodes/import_as_skeleton_bones>`
- 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.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ResourceImporterScene_property_nodes/root_name:
- .. rst-class:: classref-property
- :ref:`String<class_String>` **nodes/root_name** = ``""`` :ref:`🔗<class_ResourceImporterScene_property_nodes/root_name>`
- 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.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ResourceImporterScene_property_nodes/root_scale:
- .. rst-class:: classref-property
- :ref:`float<class_float>` **nodes/root_scale** = ``1.0`` :ref:`🔗<class_ResourceImporterScene_property_nodes/root_scale>`
- 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.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ResourceImporterScene_property_nodes/root_type:
- .. rst-class:: classref-property
- :ref:`String<class_String>` **nodes/root_type** = ``""`` :ref:`🔗<class_ResourceImporterScene_property_nodes/root_type>`
- 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.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ResourceImporterScene_property_nodes/use_node_type_suffixes:
- .. rst-class:: classref-property
- :ref:`bool<class_bool>` **nodes/use_node_type_suffixes** = ``true`` :ref:`🔗<class_ResourceImporterScene_property_nodes/use_node_type_suffixes>`
- 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.
- .. rst-class:: classref-item-separator
- ----
- .. _class_ResourceImporterScene_property_skins/use_named_skins:
- .. rst-class:: classref-property
- :ref:`bool<class_bool>` **skins/use_named_skins** = ``true`` :ref:`🔗<class_ResourceImporterScene_property_skins/use_named_skins>`
- 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:
- - The :ref:`Skeleton3D<class_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 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``).
- 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.
- .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
- .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
- .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
- .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
- .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
- .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
- .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
- .. |void| replace:: :abbr:`void (No return value.)`
|