Skip to content

Latest commit

 

History

History
112 lines (68 loc) · 5.38 KB

class_resourceimporterobj.rst

File metadata and controls

112 lines (68 loc) · 5.38 KB
github_url:hide

ResourceImporterOBJ

Inherits: :ref:`ResourceImporter<class_ResourceImporter>` < :ref:`RefCounted<class_RefCounted>` < :ref:`Object<class_Object>`

Imports an OBJ 3D model as a standalone :ref:`Mesh<class_Mesh>` or scene.

.. rst-class:: classref-introduction-group

Description

Unlike :ref:`ResourceImporterScene<class_ResourceImporterScene>`, ResourceImporterOBJ will import a single :ref:`Mesh<class_Mesh>` resource by default instead of importing a :ref:`PackedScene<class_PackedScene>`. This makes it easier to use the :ref:`Mesh<class_Mesh>` resource in nodes that expect direct :ref:`Mesh<class_Mesh>` resources, such as :ref:`GridMap<class_GridMap>`, :ref:`GPUParticles3D<class_GPUParticles3D>` or :ref:`CPUParticles3D<class_CPUParticles3D>`. Note that it is still possible to save mesh resources from 3D scenes using the Advanced Import Settings dialog, regardless of the source format.

See also :ref:`ResourceImporterScene<class_ResourceImporterScene>`, which is used for more advanced 3D formats such as glTF.

.. rst-class:: classref-introduction-group

Tutorials

.. rst-class:: classref-reftable-group

Properties

:ref:`bool<class_bool>` :ref:`generate_tangents<class_ResourceImporterOBJ_property_generate_tangents>` true
:ref:`Vector3<class_Vector3>` :ref:`offset_mesh<class_ResourceImporterOBJ_property_offset_mesh>` Vector3(0, 0, 0)
:ref:`bool<class_bool>` :ref:`optimize_mesh<class_ResourceImporterOBJ_property_optimize_mesh>` true
:ref:`Vector3<class_Vector3>` :ref:`scale_mesh<class_ResourceImporterOBJ_property_scale_mesh>` Vector3(1, 1, 1)
.. rst-class:: classref-section-separator


.. rst-class:: classref-descriptions-group

Property Descriptions

.. rst-class:: classref-property

:ref:`bool<class_bool>` generate_tangents = true

If true, generate vertex tangents using Mikktspace if the source mesh doesn'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


.. rst-class:: classref-property

:ref:`Vector3<class_Vector3>` offset_mesh = Vector3(0, 0, 0)

Offsets the mesh's data by the specified value. This can be used to work around misaligned meshes without having to modify the source file.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`bool<class_bool>` optimize_mesh = true

Unused parameter. This currently has no effect.

.. rst-class:: classref-item-separator


.. rst-class:: classref-property

:ref:`Vector3<class_Vector3>` scale_mesh = Vector3(1, 1, 1)

Scales the mesh's data by the specified value. This can be used to work around misscaled meshes without having to modify the source file.