class_gltfdocument.rst 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439
  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/modules/gltf/doc_classes/GLTFDocument.xml.
  6. .. _class_GLTFDocument:
  7. GLTFDocument
  8. ============
  9. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. **Inherited By:** :ref:`FBXDocument<class_FBXDocument>`
  11. Class for importing and exporting glTF files in and out of Godot.
  12. .. rst-class:: classref-introduction-group
  13. Description
  14. -----------
  15. GLTFDocument supports reading data from a glTF file, buffer, or Godot scene. This data can then be written to the filesystem, buffer, or used to create a Godot scene.
  16. All of the data in a glTF scene is stored in the :ref:`GLTFState<class_GLTFState>` class. GLTFDocument processes state objects, but does not contain any scene data itself. GLTFDocument has member variables to store export configuration settings such as the image format, but is otherwise stateless. Multiple scenes can be processed with the same settings using the same GLTFDocument object and different :ref:`GLTFState<class_GLTFState>` objects.
  17. GLTFDocument can be extended with arbitrary functionality by extending the :ref:`GLTFDocumentExtension<class_GLTFDocumentExtension>` class and registering it with GLTFDocument via :ref:`register_gltf_document_extension()<class_GLTFDocument_method_register_gltf_document_extension>`. This allows for custom data to be imported and exported.
  18. .. rst-class:: classref-introduction-group
  19. Tutorials
  20. ---------
  21. - :doc:`Runtime file loading and saving <../tutorials/io/runtime_file_loading_and_saving>`
  22. - `glTF 'What the duck?' guide <https://www.khronos.org/files/gltf20-reference-guide.pdf>`__
  23. - `Khronos glTF specification <https://registry.khronos.org/glTF/>`__
  24. .. rst-class:: classref-reftable-group
  25. Properties
  26. ----------
  27. .. table::
  28. :widths: auto
  29. +---------------------------------------------------------+-----------------------------------------------------------------------------------+------------+
  30. | :ref:`String<class_String>` | :ref:`fallback_image_format<class_GLTFDocument_property_fallback_image_format>` | ``"None"`` |
  31. +---------------------------------------------------------+-----------------------------------------------------------------------------------+------------+
  32. | :ref:`float<class_float>` | :ref:`fallback_image_quality<class_GLTFDocument_property_fallback_image_quality>` | ``0.25`` |
  33. +---------------------------------------------------------+-----------------------------------------------------------------------------------+------------+
  34. | :ref:`String<class_String>` | :ref:`image_format<class_GLTFDocument_property_image_format>` | ``"PNG"`` |
  35. +---------------------------------------------------------+-----------------------------------------------------------------------------------+------------+
  36. | :ref:`float<class_float>` | :ref:`lossy_quality<class_GLTFDocument_property_lossy_quality>` | ``0.75`` |
  37. +---------------------------------------------------------+-----------------------------------------------------------------------------------+------------+
  38. | :ref:`RootNodeMode<enum_GLTFDocument_RootNodeMode>` | :ref:`root_node_mode<class_GLTFDocument_property_root_node_mode>` | ``0`` |
  39. +---------------------------------------------------------+-----------------------------------------------------------------------------------+------------+
  40. | :ref:`VisibilityMode<enum_GLTFDocument_VisibilityMode>` | :ref:`visibility_mode<class_GLTFDocument_property_visibility_mode>` | ``0`` |
  41. +---------------------------------------------------------+-----------------------------------------------------------------------------------+------------+
  42. .. rst-class:: classref-reftable-group
  43. Methods
  44. -------
  45. .. table::
  46. :widths: auto
  47. +---------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`append_from_buffer<class_GLTFDocument_method_append_from_buffer>`\ (\ bytes\: :ref:`PackedByteArray<class_PackedByteArray>`, base_path\: :ref:`String<class_String>`, state\: :ref:`GLTFState<class_GLTFState>`, flags\: :ref:`int<class_int>` = 0\ ) |
  49. +---------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`append_from_file<class_GLTFDocument_method_append_from_file>`\ (\ path\: :ref:`String<class_String>`, state\: :ref:`GLTFState<class_GLTFState>`, flags\: :ref:`int<class_int>` = 0, base_path\: :ref:`String<class_String>` = ""\ ) |
  51. +---------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`append_from_scene<class_GLTFDocument_method_append_from_scene>`\ (\ node\: :ref:`Node<class_Node>`, state\: :ref:`GLTFState<class_GLTFState>`, flags\: :ref:`int<class_int>` = 0\ ) |
  53. +---------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  54. | :ref:`GLTFObjectModelProperty<class_GLTFObjectModelProperty>` | :ref:`export_object_model_property<class_GLTFDocument_method_export_object_model_property>`\ (\ state\: :ref:`GLTFState<class_GLTFState>`, node_path\: :ref:`NodePath<class_NodePath>`, godot_node\: :ref:`Node<class_Node>`, gltf_node_index\: :ref:`int<class_int>`\ ) |static| |
  55. +---------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  56. | :ref:`PackedByteArray<class_PackedByteArray>` | :ref:`generate_buffer<class_GLTFDocument_method_generate_buffer>`\ (\ state\: :ref:`GLTFState<class_GLTFState>`\ ) |
  57. +---------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | :ref:`Node<class_Node>` | :ref:`generate_scene<class_GLTFDocument_method_generate_scene>`\ (\ state\: :ref:`GLTFState<class_GLTFState>`, bake_fps\: :ref:`float<class_float>` = 30, trimming\: :ref:`bool<class_bool>` = false, remove_immutable_tracks\: :ref:`bool<class_bool>` = true\ ) |
  59. +---------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_supported_gltf_extensions<class_GLTFDocument_method_get_supported_gltf_extensions>`\ (\ ) |static| |
  61. +---------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | :ref:`GLTFObjectModelProperty<class_GLTFObjectModelProperty>` | :ref:`import_object_model_property<class_GLTFDocument_method_import_object_model_property>`\ (\ state\: :ref:`GLTFState<class_GLTFState>`, json_pointer\: :ref:`String<class_String>`\ ) |static| |
  63. +---------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | |void| | :ref:`register_gltf_document_extension<class_GLTFDocument_method_register_gltf_document_extension>`\ (\ extension\: :ref:`GLTFDocumentExtension<class_GLTFDocumentExtension>`, first_priority\: :ref:`bool<class_bool>` = false\ ) |static| |
  65. +---------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | |void| | :ref:`unregister_gltf_document_extension<class_GLTFDocument_method_unregister_gltf_document_extension>`\ (\ extension\: :ref:`GLTFDocumentExtension<class_GLTFDocumentExtension>`\ ) |static| |
  67. +---------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`write_to_filesystem<class_GLTFDocument_method_write_to_filesystem>`\ (\ state\: :ref:`GLTFState<class_GLTFState>`, path\: :ref:`String<class_String>`\ ) |
  69. +---------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. .. rst-class:: classref-section-separator
  71. ----
  72. .. rst-class:: classref-descriptions-group
  73. Enumerations
  74. ------------
  75. .. _enum_GLTFDocument_RootNodeMode:
  76. .. rst-class:: classref-enumeration
  77. enum **RootNodeMode**: :ref:`🔗<enum_GLTFDocument_RootNodeMode>`
  78. .. _class_GLTFDocument_constant_ROOT_NODE_MODE_SINGLE_ROOT:
  79. .. rst-class:: classref-enumeration-constant
  80. :ref:`RootNodeMode<enum_GLTFDocument_RootNodeMode>` **ROOT_NODE_MODE_SINGLE_ROOT** = ``0``
  81. Treat the Godot scene's root node as the root node of the glTF file, and mark it as the single root node via the ``GODOT_single_root`` glTF extension. This will be parsed the same as :ref:`ROOT_NODE_MODE_KEEP_ROOT<class_GLTFDocument_constant_ROOT_NODE_MODE_KEEP_ROOT>` if the implementation does not support ``GODOT_single_root``.
  82. .. _class_GLTFDocument_constant_ROOT_NODE_MODE_KEEP_ROOT:
  83. .. rst-class:: classref-enumeration-constant
  84. :ref:`RootNodeMode<enum_GLTFDocument_RootNodeMode>` **ROOT_NODE_MODE_KEEP_ROOT** = ``1``
  85. Treat the Godot scene's root node as the root node of the glTF file, but do not mark it as anything special. An extra root node will be generated when importing into Godot. This uses only vanilla glTF features. This is equivalent to the behavior in Godot 4.1 and earlier.
  86. .. _class_GLTFDocument_constant_ROOT_NODE_MODE_MULTI_ROOT:
  87. .. rst-class:: classref-enumeration-constant
  88. :ref:`RootNodeMode<enum_GLTFDocument_RootNodeMode>` **ROOT_NODE_MODE_MULTI_ROOT** = ``2``
  89. Treat the Godot scene's root node as the name of the glTF scene, and add all of its children as root nodes of the glTF file. This uses only vanilla glTF features. This avoids an extra root node, but only the name of the Godot scene's root node will be preserved, as it will not be saved as a node.
  90. .. rst-class:: classref-item-separator
  91. ----
  92. .. _enum_GLTFDocument_VisibilityMode:
  93. .. rst-class:: classref-enumeration
  94. enum **VisibilityMode**: :ref:`🔗<enum_GLTFDocument_VisibilityMode>`
  95. .. _class_GLTFDocument_constant_VISIBILITY_MODE_INCLUDE_REQUIRED:
  96. .. rst-class:: classref-enumeration-constant
  97. :ref:`VisibilityMode<enum_GLTFDocument_VisibilityMode>` **VISIBILITY_MODE_INCLUDE_REQUIRED** = ``0``
  98. If the scene contains any non-visible nodes, include them, mark them as non-visible with ``KHR_node_visibility``, and require that importers respect their non-visibility. Downside: If the importer does not support ``KHR_node_visibility``, the file cannot be imported.
  99. .. _class_GLTFDocument_constant_VISIBILITY_MODE_INCLUDE_OPTIONAL:
  100. .. rst-class:: classref-enumeration-constant
  101. :ref:`VisibilityMode<enum_GLTFDocument_VisibilityMode>` **VISIBILITY_MODE_INCLUDE_OPTIONAL** = ``1``
  102. If the scene contains any non-visible nodes, include them, mark them as non-visible with ``KHR_node_visibility``, and do not impose any requirements on importers. Downside: If the importer does not support ``KHR_node_visibility``, invisible objects will be visible.
  103. .. _class_GLTFDocument_constant_VISIBILITY_MODE_EXCLUDE:
  104. .. rst-class:: classref-enumeration-constant
  105. :ref:`VisibilityMode<enum_GLTFDocument_VisibilityMode>` **VISIBILITY_MODE_EXCLUDE** = ``2``
  106. If the scene contains any non-visible nodes, do not include them in the export. This is the same as the behavior in Godot 4.4 and earlier. Downside: Invisible nodes will not exist in the exported file.
  107. .. rst-class:: classref-section-separator
  108. ----
  109. .. rst-class:: classref-descriptions-group
  110. Property Descriptions
  111. ---------------------
  112. .. _class_GLTFDocument_property_fallback_image_format:
  113. .. rst-class:: classref-property
  114. :ref:`String<class_String>` **fallback_image_format** = ``"None"`` :ref:`🔗<class_GLTFDocument_property_fallback_image_format>`
  115. .. rst-class:: classref-property-setget
  116. - |void| **set_fallback_image_format**\ (\ value\: :ref:`String<class_String>`\ )
  117. - :ref:`String<class_String>` **get_fallback_image_format**\ (\ )
  118. The user-friendly name of the fallback image format. This is used when exporting the glTF file, including writing to a file and writing to a byte array.
  119. This property may only be one of "None", "PNG", or "JPEG", and is only used when the :ref:`image_format<class_GLTFDocument_property_image_format>` is not one of "None", "PNG", or "JPEG". If having multiple extension image formats is desired, that can be done using a :ref:`GLTFDocumentExtension<class_GLTFDocumentExtension>` class - this property only covers the use case of providing a base glTF fallback image when using a custom image format.
  120. .. rst-class:: classref-item-separator
  121. ----
  122. .. _class_GLTFDocument_property_fallback_image_quality:
  123. .. rst-class:: classref-property
  124. :ref:`float<class_float>` **fallback_image_quality** = ``0.25`` :ref:`🔗<class_GLTFDocument_property_fallback_image_quality>`
  125. .. rst-class:: classref-property-setget
  126. - |void| **set_fallback_image_quality**\ (\ value\: :ref:`float<class_float>`\ )
  127. - :ref:`float<class_float>` **get_fallback_image_quality**\ (\ )
  128. The quality of the fallback image, if any. For PNG files, this downscales the image on both dimensions by this factor. For JPEG files, this is the lossy quality of the image. A low value is recommended, since including multiple high quality images in a glTF file defeats the file size gains of using a more efficient image format.
  129. .. rst-class:: classref-item-separator
  130. ----
  131. .. _class_GLTFDocument_property_image_format:
  132. .. rst-class:: classref-property
  133. :ref:`String<class_String>` **image_format** = ``"PNG"`` :ref:`🔗<class_GLTFDocument_property_image_format>`
  134. .. rst-class:: classref-property-setget
  135. - |void| **set_image_format**\ (\ value\: :ref:`String<class_String>`\ )
  136. - :ref:`String<class_String>` **get_image_format**\ (\ )
  137. The user-friendly name of the export image format. This is used when exporting the glTF file, including writing to a file and writing to a byte array.
  138. By default, Godot allows the following options: "None", "PNG", "JPEG", "Lossless WebP", and "Lossy WebP". Support for more image formats can be added in :ref:`GLTFDocumentExtension<class_GLTFDocumentExtension>` classes. A single extension class can provide multiple options for the specific format to use, or even an option that uses multiple formats at once.
  139. .. rst-class:: classref-item-separator
  140. ----
  141. .. _class_GLTFDocument_property_lossy_quality:
  142. .. rst-class:: classref-property
  143. :ref:`float<class_float>` **lossy_quality** = ``0.75`` :ref:`🔗<class_GLTFDocument_property_lossy_quality>`
  144. .. rst-class:: classref-property-setget
  145. - |void| **set_lossy_quality**\ (\ value\: :ref:`float<class_float>`\ )
  146. - :ref:`float<class_float>` **get_lossy_quality**\ (\ )
  147. If :ref:`image_format<class_GLTFDocument_property_image_format>` is a lossy image format, this determines the lossy quality of the image. On a range of ``0.0`` to ``1.0``, where ``0.0`` is the lowest quality and ``1.0`` is the highest quality. A lossy quality of ``1.0`` is not the same as lossless.
  148. .. rst-class:: classref-item-separator
  149. ----
  150. .. _class_GLTFDocument_property_root_node_mode:
  151. .. rst-class:: classref-property
  152. :ref:`RootNodeMode<enum_GLTFDocument_RootNodeMode>` **root_node_mode** = ``0`` :ref:`🔗<class_GLTFDocument_property_root_node_mode>`
  153. .. rst-class:: classref-property-setget
  154. - |void| **set_root_node_mode**\ (\ value\: :ref:`RootNodeMode<enum_GLTFDocument_RootNodeMode>`\ )
  155. - :ref:`RootNodeMode<enum_GLTFDocument_RootNodeMode>` **get_root_node_mode**\ (\ )
  156. How to process the root node during export. The default and recommended value is :ref:`ROOT_NODE_MODE_SINGLE_ROOT<class_GLTFDocument_constant_ROOT_NODE_MODE_SINGLE_ROOT>`.
  157. \ **Note:** Regardless of how the glTF file is exported, when importing, the root node type and name can be overridden in the scene import settings tab.
  158. .. rst-class:: classref-item-separator
  159. ----
  160. .. _class_GLTFDocument_property_visibility_mode:
  161. .. rst-class:: classref-property
  162. :ref:`VisibilityMode<enum_GLTFDocument_VisibilityMode>` **visibility_mode** = ``0`` :ref:`🔗<class_GLTFDocument_property_visibility_mode>`
  163. .. rst-class:: classref-property-setget
  164. - |void| **set_visibility_mode**\ (\ value\: :ref:`VisibilityMode<enum_GLTFDocument_VisibilityMode>`\ )
  165. - :ref:`VisibilityMode<enum_GLTFDocument_VisibilityMode>` **get_visibility_mode**\ (\ )
  166. How to deal with node visibility during export. This setting does nothing if all nodes are visible. The default and recommended value is :ref:`VISIBILITY_MODE_INCLUDE_REQUIRED<class_GLTFDocument_constant_VISIBILITY_MODE_INCLUDE_REQUIRED>`, which uses the ``KHR_node_visibility`` extension.
  167. .. rst-class:: classref-section-separator
  168. ----
  169. .. rst-class:: classref-descriptions-group
  170. Method Descriptions
  171. -------------------
  172. .. _class_GLTFDocument_method_append_from_buffer:
  173. .. rst-class:: classref-method
  174. :ref:`Error<enum_@GlobalScope_Error>` **append_from_buffer**\ (\ bytes\: :ref:`PackedByteArray<class_PackedByteArray>`, base_path\: :ref:`String<class_String>`, state\: :ref:`GLTFState<class_GLTFState>`, flags\: :ref:`int<class_int>` = 0\ ) :ref:`🔗<class_GLTFDocument_method_append_from_buffer>`
  175. Takes a :ref:`PackedByteArray<class_PackedByteArray>` defining a glTF and imports the data to the given :ref:`GLTFState<class_GLTFState>` object through the ``state`` parameter.
  176. \ **Note:** The ``base_path`` tells :ref:`append_from_buffer()<class_GLTFDocument_method_append_from_buffer>` where to find dependencies and can be empty.
  177. .. rst-class:: classref-item-separator
  178. ----
  179. .. _class_GLTFDocument_method_append_from_file:
  180. .. rst-class:: classref-method
  181. :ref:`Error<enum_@GlobalScope_Error>` **append_from_file**\ (\ path\: :ref:`String<class_String>`, state\: :ref:`GLTFState<class_GLTFState>`, flags\: :ref:`int<class_int>` = 0, base_path\: :ref:`String<class_String>` = ""\ ) :ref:`🔗<class_GLTFDocument_method_append_from_file>`
  182. Takes a path to a glTF file and imports the data at that file path to the given :ref:`GLTFState<class_GLTFState>` object through the ``state`` parameter.
  183. \ **Note:** The ``base_path`` tells :ref:`append_from_file()<class_GLTFDocument_method_append_from_file>` where to find dependencies and can be empty.
  184. .. rst-class:: classref-item-separator
  185. ----
  186. .. _class_GLTFDocument_method_append_from_scene:
  187. .. rst-class:: classref-method
  188. :ref:`Error<enum_@GlobalScope_Error>` **append_from_scene**\ (\ node\: :ref:`Node<class_Node>`, state\: :ref:`GLTFState<class_GLTFState>`, flags\: :ref:`int<class_int>` = 0\ ) :ref:`🔗<class_GLTFDocument_method_append_from_scene>`
  189. Takes a Godot Engine scene node and exports it and its descendants to the given :ref:`GLTFState<class_GLTFState>` object through the ``state`` parameter.
  190. .. rst-class:: classref-item-separator
  191. ----
  192. .. _class_GLTFDocument_method_export_object_model_property:
  193. .. rst-class:: classref-method
  194. :ref:`GLTFObjectModelProperty<class_GLTFObjectModelProperty>` **export_object_model_property**\ (\ state\: :ref:`GLTFState<class_GLTFState>`, node_path\: :ref:`NodePath<class_NodePath>`, godot_node\: :ref:`Node<class_Node>`, gltf_node_index\: :ref:`int<class_int>`\ ) |static| :ref:`🔗<class_GLTFDocument_method_export_object_model_property>`
  195. Determines a mapping between the given Godot ``node_path`` and the corresponding glTF Object Model JSON pointer(s) in the generated glTF file. The details of this mapping are returned in a :ref:`GLTFObjectModelProperty<class_GLTFObjectModelProperty>` object. Additional mappings can be supplied via the :ref:`GLTFDocumentExtension._import_object_model_property()<class_GLTFDocumentExtension_private_method__import_object_model_property>` callback method.
  196. .. rst-class:: classref-item-separator
  197. ----
  198. .. _class_GLTFDocument_method_generate_buffer:
  199. .. rst-class:: classref-method
  200. :ref:`PackedByteArray<class_PackedByteArray>` **generate_buffer**\ (\ state\: :ref:`GLTFState<class_GLTFState>`\ ) :ref:`🔗<class_GLTFDocument_method_generate_buffer>`
  201. Takes a :ref:`GLTFState<class_GLTFState>` object through the ``state`` parameter and returns a glTF :ref:`PackedByteArray<class_PackedByteArray>`.
  202. .. rst-class:: classref-item-separator
  203. ----
  204. .. _class_GLTFDocument_method_generate_scene:
  205. .. rst-class:: classref-method
  206. :ref:`Node<class_Node>` **generate_scene**\ (\ state\: :ref:`GLTFState<class_GLTFState>`, bake_fps\: :ref:`float<class_float>` = 30, trimming\: :ref:`bool<class_bool>` = false, remove_immutable_tracks\: :ref:`bool<class_bool>` = true\ ) :ref:`🔗<class_GLTFDocument_method_generate_scene>`
  207. Takes a :ref:`GLTFState<class_GLTFState>` object through the ``state`` parameter and returns a Godot Engine scene node.
  208. The ``bake_fps`` parameter overrides the bake_fps in ``state``.
  209. .. rst-class:: classref-item-separator
  210. ----
  211. .. _class_GLTFDocument_method_get_supported_gltf_extensions:
  212. .. rst-class:: classref-method
  213. :ref:`PackedStringArray<class_PackedStringArray>` **get_supported_gltf_extensions**\ (\ ) |static| :ref:`🔗<class_GLTFDocument_method_get_supported_gltf_extensions>`
  214. Returns a list of all support glTF extensions, including extensions supported directly by the engine, and extensions supported by user plugins registering :ref:`GLTFDocumentExtension<class_GLTFDocumentExtension>` classes.
  215. \ **Note:** If this method is run before a GLTFDocumentExtension is registered, its extensions won't be included in the list. Be sure to only run this method after all extensions are registered. If you run this when the engine starts, consider waiting a frame before calling this method to ensure all extensions are registered.
  216. .. rst-class:: classref-item-separator
  217. ----
  218. .. _class_GLTFDocument_method_import_object_model_property:
  219. .. rst-class:: classref-method
  220. :ref:`GLTFObjectModelProperty<class_GLTFObjectModelProperty>` **import_object_model_property**\ (\ state\: :ref:`GLTFState<class_GLTFState>`, json_pointer\: :ref:`String<class_String>`\ ) |static| :ref:`🔗<class_GLTFDocument_method_import_object_model_property>`
  221. Determines a mapping between the given glTF Object Model ``json_pointer`` and the corresponding Godot node path(s) in the generated Godot scene. The details of this mapping are returned in a :ref:`GLTFObjectModelProperty<class_GLTFObjectModelProperty>` object. Additional mappings can be supplied via the :ref:`GLTFDocumentExtension._export_object_model_property()<class_GLTFDocumentExtension_private_method__export_object_model_property>` callback method.
  222. .. rst-class:: classref-item-separator
  223. ----
  224. .. _class_GLTFDocument_method_register_gltf_document_extension:
  225. .. rst-class:: classref-method
  226. |void| **register_gltf_document_extension**\ (\ extension\: :ref:`GLTFDocumentExtension<class_GLTFDocumentExtension>`, first_priority\: :ref:`bool<class_bool>` = false\ ) |static| :ref:`🔗<class_GLTFDocument_method_register_gltf_document_extension>`
  227. Registers the given :ref:`GLTFDocumentExtension<class_GLTFDocumentExtension>` instance with GLTFDocument. If ``first_priority`` is ``true``, this extension will be run first. Otherwise, it will be run last.
  228. \ **Note:** Like GLTFDocument itself, all GLTFDocumentExtension classes must be stateless in order to function properly. If you need to store data, use the ``set_additional_data`` and ``get_additional_data`` methods in :ref:`GLTFState<class_GLTFState>` or :ref:`GLTFNode<class_GLTFNode>`.
  229. .. rst-class:: classref-item-separator
  230. ----
  231. .. _class_GLTFDocument_method_unregister_gltf_document_extension:
  232. .. rst-class:: classref-method
  233. |void| **unregister_gltf_document_extension**\ (\ extension\: :ref:`GLTFDocumentExtension<class_GLTFDocumentExtension>`\ ) |static| :ref:`🔗<class_GLTFDocument_method_unregister_gltf_document_extension>`
  234. Unregisters the given :ref:`GLTFDocumentExtension<class_GLTFDocumentExtension>` instance.
  235. .. rst-class:: classref-item-separator
  236. ----
  237. .. _class_GLTFDocument_method_write_to_filesystem:
  238. .. rst-class:: classref-method
  239. :ref:`Error<enum_@GlobalScope_Error>` **write_to_filesystem**\ (\ state\: :ref:`GLTFState<class_GLTFState>`, path\: :ref:`String<class_String>`\ ) :ref:`🔗<class_GLTFDocument_method_write_to_filesystem>`
  240. Takes a :ref:`GLTFState<class_GLTFState>` object through the ``state`` parameter and writes a glTF file to the filesystem.
  241. \ **Note:** The extension of the glTF file determines if it is a .glb binary file or a .gltf text file.
  242. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  243. .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
  244. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  245. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  246. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  247. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  248. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  249. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  250. .. |void| replace:: :abbr:`void (No return value.)`