class_resourceimporterobj.rst 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  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/ResourceImporterOBJ.xml.
  6. .. _class_ResourceImporterOBJ:
  7. ResourceImporterOBJ
  8. ===================
  9. **Inherits:** :ref:`ResourceImporter<class_ResourceImporter>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. Imports an OBJ 3D model as an independent :ref:`Mesh<class_Mesh>` or scene.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. 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.
  15. See also :ref:`ResourceImporterScene<class_ResourceImporterScene>`, which is used for more advanced 3D formats such as glTF.
  16. .. rst-class:: classref-introduction-group
  17. Tutorials
  18. ---------
  19. - :doc:`Importing 3D scenes <../tutorials/assets_pipeline/importing_3d_scenes/index>`
  20. .. rst-class:: classref-reftable-group
  21. Properties
  22. ----------
  23. .. table::
  24. :widths: auto
  25. +-------------------------------+--------------------------------------------------------------------------------------------------------------+----------------------+
  26. | :ref:`bool<class_bool>` | :ref:`force_disable_mesh_compression<class_ResourceImporterOBJ_property_force_disable_mesh_compression>` | ``false`` |
  27. +-------------------------------+--------------------------------------------------------------------------------------------------------------+----------------------+
  28. | :ref:`bool<class_bool>` | :ref:`generate_lightmap_uv2<class_ResourceImporterOBJ_property_generate_lightmap_uv2>` | ``false`` |
  29. +-------------------------------+--------------------------------------------------------------------------------------------------------------+----------------------+
  30. | :ref:`float<class_float>` | :ref:`generate_lightmap_uv2_texel_size<class_ResourceImporterOBJ_property_generate_lightmap_uv2_texel_size>` | ``0.2`` |
  31. +-------------------------------+--------------------------------------------------------------------------------------------------------------+----------------------+
  32. | :ref:`bool<class_bool>` | :ref:`generate_lods<class_ResourceImporterOBJ_property_generate_lods>` | ``true`` |
  33. +-------------------------------+--------------------------------------------------------------------------------------------------------------+----------------------+
  34. | :ref:`bool<class_bool>` | :ref:`generate_shadow_mesh<class_ResourceImporterOBJ_property_generate_shadow_mesh>` | ``true`` |
  35. +-------------------------------+--------------------------------------------------------------------------------------------------------------+----------------------+
  36. | :ref:`bool<class_bool>` | :ref:`generate_tangents<class_ResourceImporterOBJ_property_generate_tangents>` | ``true`` |
  37. +-------------------------------+--------------------------------------------------------------------------------------------------------------+----------------------+
  38. | :ref:`Vector3<class_Vector3>` | :ref:`offset_mesh<class_ResourceImporterOBJ_property_offset_mesh>` | ``Vector3(0, 0, 0)`` |
  39. +-------------------------------+--------------------------------------------------------------------------------------------------------------+----------------------+
  40. | :ref:`Vector3<class_Vector3>` | :ref:`scale_mesh<class_ResourceImporterOBJ_property_scale_mesh>` | ``Vector3(1, 1, 1)`` |
  41. +-------------------------------+--------------------------------------------------------------------------------------------------------------+----------------------+
  42. .. rst-class:: classref-section-separator
  43. ----
  44. .. rst-class:: classref-descriptions-group
  45. Property Descriptions
  46. ---------------------
  47. .. _class_ResourceImporterOBJ_property_force_disable_mesh_compression:
  48. .. rst-class:: classref-property
  49. :ref:`bool<class_bool>` **force_disable_mesh_compression** = ``false`` :ref:`🔗<class_ResourceImporterOBJ_property_force_disable_mesh_compression>`
  50. 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.
  51. .. rst-class:: classref-item-separator
  52. ----
  53. .. _class_ResourceImporterOBJ_property_generate_lightmap_uv2:
  54. .. rst-class:: classref-property
  55. :ref:`bool<class_bool>` **generate_lightmap_uv2** = ``false`` :ref:`🔗<class_ResourceImporterOBJ_property_generate_lightmap_uv2>`
  56. If ``true``, generates UV2 on import for :ref:`LightmapGI<class_LightmapGI>` baking.
  57. .. rst-class:: classref-item-separator
  58. ----
  59. .. _class_ResourceImporterOBJ_property_generate_lightmap_uv2_texel_size:
  60. .. rst-class:: classref-property
  61. :ref:`float<class_float>` **generate_lightmap_uv2_texel_size** = ``0.2`` :ref:`🔗<class_ResourceImporterOBJ_property_generate_lightmap_uv2_texel_size>`
  62. 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.
  63. \ **Note:** Only effective if :ref:`generate_lightmap_uv2<class_ResourceImporterOBJ_property_generate_lightmap_uv2>` is ``true``.
  64. .. rst-class:: classref-item-separator
  65. ----
  66. .. _class_ResourceImporterOBJ_property_generate_lods:
  67. .. rst-class:: classref-property
  68. :ref:`bool<class_bool>` **generate_lods** = ``true`` :ref:`🔗<class_ResourceImporterOBJ_property_generate_lods>`
  69. 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.
  70. .. rst-class:: classref-item-separator
  71. ----
  72. .. _class_ResourceImporterOBJ_property_generate_shadow_mesh:
  73. .. rst-class:: classref-property
  74. :ref:`bool<class_bool>` **generate_shadow_mesh** = ``true`` :ref:`🔗<class_ResourceImporterOBJ_property_generate_shadow_mesh>`
  75. 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).
  76. .. rst-class:: classref-item-separator
  77. ----
  78. .. _class_ResourceImporterOBJ_property_generate_tangents:
  79. .. rst-class:: classref-property
  80. :ref:`bool<class_bool>` **generate_tangents** = ``true`` :ref:`🔗<class_ResourceImporterOBJ_property_generate_tangents>`
  81. If ``true``, generate vertex tangents using `Mikktspace <http://www.mikktspace.com/>`__ 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.
  82. 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.
  83. .. rst-class:: classref-item-separator
  84. ----
  85. .. _class_ResourceImporterOBJ_property_offset_mesh:
  86. .. rst-class:: classref-property
  87. :ref:`Vector3<class_Vector3>` **offset_mesh** = ``Vector3(0, 0, 0)`` :ref:`🔗<class_ResourceImporterOBJ_property_offset_mesh>`
  88. 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.
  89. .. rst-class:: classref-item-separator
  90. ----
  91. .. _class_ResourceImporterOBJ_property_scale_mesh:
  92. .. rst-class:: classref-property
  93. :ref:`Vector3<class_Vector3>` **scale_mesh** = ``Vector3(1, 1, 1)`` :ref:`🔗<class_ResourceImporterOBJ_property_scale_mesh>`
  94. 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.
  95. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  96. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  97. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  98. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  99. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  100. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  101. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  102. .. |void| replace:: :abbr:`void (No return value.)`