class_gltfstate.rst 62 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002
  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/GLTFState.xml.
  6. .. _class_GLTFState:
  7. GLTFState
  8. =========
  9. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. **Inherited By:** :ref:`FBXState<class_FBXState>`
  11. Represents all data of a glTF file.
  12. .. rst-class:: classref-introduction-group
  13. Description
  14. -----------
  15. Contains all nodes and resources of a glTF file. This is used by :ref:`GLTFDocument<class_GLTFDocument>` as data storage, which allows :ref:`GLTFDocument<class_GLTFDocument>` and all :ref:`GLTFDocumentExtension<class_GLTFDocumentExtension>` classes to remain stateless.
  16. GLTFState can be populated by :ref:`GLTFDocument<class_GLTFDocument>` reading a file or by converting a Godot scene. Then the data can either be used to create a Godot scene or save to a glTF file. The code that converts to/from a Godot scene can be intercepted at arbitrary points by :ref:`GLTFDocumentExtension<class_GLTFDocumentExtension>` classes. This allows for custom data to be stored in the glTF file or for custom data to be converted to/from Godot nodes.
  17. .. rst-class:: classref-introduction-group
  18. Tutorials
  19. ---------
  20. - :doc:`Runtime file loading and saving <../tutorials/io/runtime_file_loading_and_saving>`
  21. - `glTF asset header schema <https://github.com/KhronosGroup/glTF/blob/main/specification/2.0/schema/asset.schema.json">`__
  22. .. rst-class:: classref-reftable-group
  23. Properties
  24. ----------
  25. .. table::
  26. :widths: auto
  27. +----------------------------------------------------------------------------+------------------------------------------------------------------------------------+------------------------+
  28. | :ref:`float<class_float>` | :ref:`bake_fps<class_GLTFState_property_bake_fps>` | ``30.0`` |
  29. +----------------------------------------------------------------------------+------------------------------------------------------------------------------------+------------------------+
  30. | :ref:`String<class_String>` | :ref:`base_path<class_GLTFState_property_base_path>` | ``""`` |
  31. +----------------------------------------------------------------------------+------------------------------------------------------------------------------------+------------------------+
  32. | :ref:`Array<class_Array>`\[:ref:`PackedByteArray<class_PackedByteArray>`\] | :ref:`buffers<class_GLTFState_property_buffers>` | ``[]`` |
  33. +----------------------------------------------------------------------------+------------------------------------------------------------------------------------+------------------------+
  34. | :ref:`String<class_String>` | :ref:`copyright<class_GLTFState_property_copyright>` | ``""`` |
  35. +----------------------------------------------------------------------------+------------------------------------------------------------------------------------+------------------------+
  36. | :ref:`bool<class_bool>` | :ref:`create_animations<class_GLTFState_property_create_animations>` | ``true`` |
  37. +----------------------------------------------------------------------------+------------------------------------------------------------------------------------+------------------------+
  38. | :ref:`String<class_String>` | :ref:`filename<class_GLTFState_property_filename>` | ``""`` |
  39. +----------------------------------------------------------------------------+------------------------------------------------------------------------------------+------------------------+
  40. | :ref:`PackedByteArray<class_PackedByteArray>` | :ref:`glb_data<class_GLTFState_property_glb_data>` | ``PackedByteArray()`` |
  41. +----------------------------------------------------------------------------+------------------------------------------------------------------------------------+------------------------+
  42. | :ref:`bool<class_bool>` | :ref:`import_as_skeleton_bones<class_GLTFState_property_import_as_skeleton_bones>` | ``false`` |
  43. +----------------------------------------------------------------------------+------------------------------------------------------------------------------------+------------------------+
  44. | :ref:`Dictionary<class_Dictionary>` | :ref:`json<class_GLTFState_property_json>` | ``{}`` |
  45. +----------------------------------------------------------------------------+------------------------------------------------------------------------------------+------------------------+
  46. | :ref:`int<class_int>` | :ref:`major_version<class_GLTFState_property_major_version>` | ``0`` |
  47. +----------------------------------------------------------------------------+------------------------------------------------------------------------------------+------------------------+
  48. | :ref:`int<class_int>` | :ref:`minor_version<class_GLTFState_property_minor_version>` | ``0`` |
  49. +----------------------------------------------------------------------------+------------------------------------------------------------------------------------+------------------------+
  50. | :ref:`PackedInt32Array<class_PackedInt32Array>` | :ref:`root_nodes<class_GLTFState_property_root_nodes>` | ``PackedInt32Array()`` |
  51. +----------------------------------------------------------------------------+------------------------------------------------------------------------------------+------------------------+
  52. | :ref:`String<class_String>` | :ref:`scene_name<class_GLTFState_property_scene_name>` | ``""`` |
  53. +----------------------------------------------------------------------------+------------------------------------------------------------------------------------+------------------------+
  54. | :ref:`bool<class_bool>` | :ref:`use_named_skin_binds<class_GLTFState_property_use_named_skin_binds>` | ``false`` |
  55. +----------------------------------------------------------------------------+------------------------------------------------------------------------------------+------------------------+
  56. .. rst-class:: classref-reftable-group
  57. Methods
  58. -------
  59. .. table::
  60. :widths: auto
  61. +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | |void| | :ref:`add_used_extension<class_GLTFState_method_add_used_extension>`\ (\ extension_name\: :ref:`String<class_String>`, required\: :ref:`bool<class_bool>`\ ) |
  63. +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | :ref:`int<class_int>` | :ref:`append_data_to_buffers<class_GLTFState_method_append_data_to_buffers>`\ (\ data\: :ref:`PackedByteArray<class_PackedByteArray>`, deduplication\: :ref:`bool<class_bool>`\ ) |
  65. +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | :ref:`int<class_int>` | :ref:`append_gltf_node<class_GLTFState_method_append_gltf_node>`\ (\ gltf_node\: :ref:`GLTFNode<class_GLTFNode>`, godot_scene_node\: :ref:`Node<class_Node>`, parent_node_index\: :ref:`int<class_int>`\ ) |
  67. +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | :ref:`Array<class_Array>`\[:ref:`GLTFAccessor<class_GLTFAccessor>`\] | :ref:`get_accessors<class_GLTFState_method_get_accessors>`\ (\ ) |
  69. +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | :ref:`Variant<class_Variant>` | :ref:`get_additional_data<class_GLTFState_method_get_additional_data>`\ (\ extension_name\: :ref:`StringName<class_StringName>`\ ) |
  71. +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | :ref:`AnimationPlayer<class_AnimationPlayer>` | :ref:`get_animation_player<class_GLTFState_method_get_animation_player>`\ (\ idx\: :ref:`int<class_int>`\ ) |
  73. +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | :ref:`int<class_int>` | :ref:`get_animation_players_count<class_GLTFState_method_get_animation_players_count>`\ (\ idx\: :ref:`int<class_int>`\ ) |
  75. +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  76. | :ref:`Array<class_Array>`\[:ref:`GLTFAnimation<class_GLTFAnimation>`\] | :ref:`get_animations<class_GLTFState_method_get_animations>`\ (\ ) |
  77. +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  78. | :ref:`Array<class_Array>`\[:ref:`GLTFBufferView<class_GLTFBufferView>`\] | :ref:`get_buffer_views<class_GLTFState_method_get_buffer_views>`\ (\ ) |
  79. +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  80. | :ref:`Array<class_Array>`\[:ref:`GLTFCamera<class_GLTFCamera>`\] | :ref:`get_cameras<class_GLTFState_method_get_cameras>`\ (\ ) |
  81. +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  82. | :ref:`int<class_int>` | :ref:`get_handle_binary_image<class_GLTFState_method_get_handle_binary_image>`\ (\ ) |
  83. +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  84. | :ref:`Array<class_Array>`\[:ref:`Texture2D<class_Texture2D>`\] | :ref:`get_images<class_GLTFState_method_get_images>`\ (\ ) |
  85. +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  86. | :ref:`Array<class_Array>`\[:ref:`GLTFLight<class_GLTFLight>`\] | :ref:`get_lights<class_GLTFState_method_get_lights>`\ (\ ) |
  87. +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  88. | :ref:`Array<class_Array>`\[:ref:`Material<class_Material>`\] | :ref:`get_materials<class_GLTFState_method_get_materials>`\ (\ ) |
  89. +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  90. | :ref:`Array<class_Array>`\[:ref:`GLTFMesh<class_GLTFMesh>`\] | :ref:`get_meshes<class_GLTFState_method_get_meshes>`\ (\ ) |
  91. +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  92. | :ref:`int<class_int>` | :ref:`get_node_index<class_GLTFState_method_get_node_index>`\ (\ scene_node\: :ref:`Node<class_Node>`\ ) |
  93. +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  94. | :ref:`Array<class_Array>`\[:ref:`GLTFNode<class_GLTFNode>`\] | :ref:`get_nodes<class_GLTFState_method_get_nodes>`\ (\ ) |
  95. +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  96. | :ref:`Node<class_Node>` | :ref:`get_scene_node<class_GLTFState_method_get_scene_node>`\ (\ idx\: :ref:`int<class_int>`\ ) |
  97. +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  98. | :ref:`Array<class_Array>`\[:ref:`GLTFSkeleton<class_GLTFSkeleton>`\] | :ref:`get_skeletons<class_GLTFState_method_get_skeletons>`\ (\ ) |
  99. +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  100. | :ref:`Array<class_Array>`\[:ref:`GLTFSkin<class_GLTFSkin>`\] | :ref:`get_skins<class_GLTFState_method_get_skins>`\ (\ ) |
  101. +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  102. | :ref:`Array<class_Array>`\[:ref:`GLTFTextureSampler<class_GLTFTextureSampler>`\] | :ref:`get_texture_samplers<class_GLTFState_method_get_texture_samplers>`\ (\ ) |
  103. +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  104. | :ref:`Array<class_Array>`\[:ref:`GLTFTexture<class_GLTFTexture>`\] | :ref:`get_textures<class_GLTFState_method_get_textures>`\ (\ ) |
  105. +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  106. | :ref:`Array<class_Array>`\[:ref:`String<class_String>`\] | :ref:`get_unique_animation_names<class_GLTFState_method_get_unique_animation_names>`\ (\ ) |
  107. +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  108. | :ref:`Array<class_Array>`\[:ref:`String<class_String>`\] | :ref:`get_unique_names<class_GLTFState_method_get_unique_names>`\ (\ ) |
  109. +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  110. | |void| | :ref:`set_accessors<class_GLTFState_method_set_accessors>`\ (\ accessors\: :ref:`Array<class_Array>`\[:ref:`GLTFAccessor<class_GLTFAccessor>`\]\ ) |
  111. +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  112. | |void| | :ref:`set_additional_data<class_GLTFState_method_set_additional_data>`\ (\ extension_name\: :ref:`StringName<class_StringName>`, additional_data\: :ref:`Variant<class_Variant>`\ ) |
  113. +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  114. | |void| | :ref:`set_animations<class_GLTFState_method_set_animations>`\ (\ animations\: :ref:`Array<class_Array>`\[:ref:`GLTFAnimation<class_GLTFAnimation>`\]\ ) |
  115. +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  116. | |void| | :ref:`set_buffer_views<class_GLTFState_method_set_buffer_views>`\ (\ buffer_views\: :ref:`Array<class_Array>`\[:ref:`GLTFBufferView<class_GLTFBufferView>`\]\ ) |
  117. +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  118. | |void| | :ref:`set_cameras<class_GLTFState_method_set_cameras>`\ (\ cameras\: :ref:`Array<class_Array>`\[:ref:`GLTFCamera<class_GLTFCamera>`\]\ ) |
  119. +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  120. | |void| | :ref:`set_handle_binary_image<class_GLTFState_method_set_handle_binary_image>`\ (\ method\: :ref:`int<class_int>`\ ) |
  121. +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  122. | |void| | :ref:`set_images<class_GLTFState_method_set_images>`\ (\ images\: :ref:`Array<class_Array>`\[:ref:`Texture2D<class_Texture2D>`\]\ ) |
  123. +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  124. | |void| | :ref:`set_lights<class_GLTFState_method_set_lights>`\ (\ lights\: :ref:`Array<class_Array>`\[:ref:`GLTFLight<class_GLTFLight>`\]\ ) |
  125. +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  126. | |void| | :ref:`set_materials<class_GLTFState_method_set_materials>`\ (\ materials\: :ref:`Array<class_Array>`\[:ref:`Material<class_Material>`\]\ ) |
  127. +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  128. | |void| | :ref:`set_meshes<class_GLTFState_method_set_meshes>`\ (\ meshes\: :ref:`Array<class_Array>`\[:ref:`GLTFMesh<class_GLTFMesh>`\]\ ) |
  129. +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  130. | |void| | :ref:`set_nodes<class_GLTFState_method_set_nodes>`\ (\ nodes\: :ref:`Array<class_Array>`\[:ref:`GLTFNode<class_GLTFNode>`\]\ ) |
  131. +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  132. | |void| | :ref:`set_skeletons<class_GLTFState_method_set_skeletons>`\ (\ skeletons\: :ref:`Array<class_Array>`\[:ref:`GLTFSkeleton<class_GLTFSkeleton>`\]\ ) |
  133. +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  134. | |void| | :ref:`set_skins<class_GLTFState_method_set_skins>`\ (\ skins\: :ref:`Array<class_Array>`\[:ref:`GLTFSkin<class_GLTFSkin>`\]\ ) |
  135. +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  136. | |void| | :ref:`set_texture_samplers<class_GLTFState_method_set_texture_samplers>`\ (\ texture_samplers\: :ref:`Array<class_Array>`\[:ref:`GLTFTextureSampler<class_GLTFTextureSampler>`\]\ ) |
  137. +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  138. | |void| | :ref:`set_textures<class_GLTFState_method_set_textures>`\ (\ textures\: :ref:`Array<class_Array>`\[:ref:`GLTFTexture<class_GLTFTexture>`\]\ ) |
  139. +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  140. | |void| | :ref:`set_unique_animation_names<class_GLTFState_method_set_unique_animation_names>`\ (\ unique_animation_names\: :ref:`Array<class_Array>`\[:ref:`String<class_String>`\]\ ) |
  141. +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  142. | |void| | :ref:`set_unique_names<class_GLTFState_method_set_unique_names>`\ (\ unique_names\: :ref:`Array<class_Array>`\[:ref:`String<class_String>`\]\ ) |
  143. +----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  144. .. rst-class:: classref-section-separator
  145. ----
  146. .. rst-class:: classref-descriptions-group
  147. Constants
  148. ---------
  149. .. _class_GLTFState_constant_HANDLE_BINARY_DISCARD_TEXTURES:
  150. .. rst-class:: classref-constant
  151. **HANDLE_BINARY_DISCARD_TEXTURES** = ``0`` :ref:`🔗<class_GLTFState_constant_HANDLE_BINARY_DISCARD_TEXTURES>`
  152. Discards all embedded textures and uses untextured materials.
  153. .. _class_GLTFState_constant_HANDLE_BINARY_EXTRACT_TEXTURES:
  154. .. rst-class:: classref-constant
  155. **HANDLE_BINARY_EXTRACT_TEXTURES** = ``1`` :ref:`🔗<class_GLTFState_constant_HANDLE_BINARY_EXTRACT_TEXTURES>`
  156. Extracts embedded textures to be reimported and compressed. Editor only. Acts as uncompressed at runtime.
  157. .. _class_GLTFState_constant_HANDLE_BINARY_EMBED_AS_BASISU:
  158. .. rst-class:: classref-constant
  159. **HANDLE_BINARY_EMBED_AS_BASISU** = ``2`` :ref:`🔗<class_GLTFState_constant_HANDLE_BINARY_EMBED_AS_BASISU>`
  160. Embeds textures VRAM compressed with Basis Universal into the generated scene.
  161. .. _class_GLTFState_constant_HANDLE_BINARY_EMBED_AS_UNCOMPRESSED:
  162. .. rst-class:: classref-constant
  163. **HANDLE_BINARY_EMBED_AS_UNCOMPRESSED** = ``3`` :ref:`🔗<class_GLTFState_constant_HANDLE_BINARY_EMBED_AS_UNCOMPRESSED>`
  164. Embeds textures compressed losslessly into the generated scene, matching old behavior.
  165. .. rst-class:: classref-section-separator
  166. ----
  167. .. rst-class:: classref-descriptions-group
  168. Property Descriptions
  169. ---------------------
  170. .. _class_GLTFState_property_bake_fps:
  171. .. rst-class:: classref-property
  172. :ref:`float<class_float>` **bake_fps** = ``30.0`` :ref:`🔗<class_GLTFState_property_bake_fps>`
  173. .. rst-class:: classref-property-setget
  174. - |void| **set_bake_fps**\ (\ value\: :ref:`float<class_float>`\ )
  175. - :ref:`float<class_float>` **get_bake_fps**\ (\ )
  176. The baking fps of the animation for either import or export.
  177. .. rst-class:: classref-item-separator
  178. ----
  179. .. _class_GLTFState_property_base_path:
  180. .. rst-class:: classref-property
  181. :ref:`String<class_String>` **base_path** = ``""`` :ref:`🔗<class_GLTFState_property_base_path>`
  182. .. rst-class:: classref-property-setget
  183. - |void| **set_base_path**\ (\ value\: :ref:`String<class_String>`\ )
  184. - :ref:`String<class_String>` **get_base_path**\ (\ )
  185. The folder path associated with this glTF data. This is used to find other files the glTF file references, like images or binary buffers. This will be set during import when appending from a file, and will be set during export when writing to a file.
  186. .. rst-class:: classref-item-separator
  187. ----
  188. .. _class_GLTFState_property_buffers:
  189. .. rst-class:: classref-property
  190. :ref:`Array<class_Array>`\[:ref:`PackedByteArray<class_PackedByteArray>`\] **buffers** = ``[]`` :ref:`🔗<class_GLTFState_property_buffers>`
  191. .. rst-class:: classref-property-setget
  192. - |void| **set_buffers**\ (\ value\: :ref:`Array<class_Array>`\[:ref:`PackedByteArray<class_PackedByteArray>`\]\ )
  193. - :ref:`Array<class_Array>`\[:ref:`PackedByteArray<class_PackedByteArray>`\] **get_buffers**\ (\ )
  194. .. container:: contribute
  195. There is currently no description for this property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  196. .. rst-class:: classref-item-separator
  197. ----
  198. .. _class_GLTFState_property_copyright:
  199. .. rst-class:: classref-property
  200. :ref:`String<class_String>` **copyright** = ``""`` :ref:`🔗<class_GLTFState_property_copyright>`
  201. .. rst-class:: classref-property-setget
  202. - |void| **set_copyright**\ (\ value\: :ref:`String<class_String>`\ )
  203. - :ref:`String<class_String>` **get_copyright**\ (\ )
  204. The copyright string in the asset header of the glTF file. This is set during import if present and export if non-empty. See the glTF asset header documentation for more information.
  205. .. rst-class:: classref-item-separator
  206. ----
  207. .. _class_GLTFState_property_create_animations:
  208. .. rst-class:: classref-property
  209. :ref:`bool<class_bool>` **create_animations** = ``true`` :ref:`🔗<class_GLTFState_property_create_animations>`
  210. .. rst-class:: classref-property-setget
  211. - |void| **set_create_animations**\ (\ value\: :ref:`bool<class_bool>`\ )
  212. - :ref:`bool<class_bool>` **get_create_animations**\ (\ )
  213. .. container:: contribute
  214. There is currently no description for this property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  215. .. rst-class:: classref-item-separator
  216. ----
  217. .. _class_GLTFState_property_filename:
  218. .. rst-class:: classref-property
  219. :ref:`String<class_String>` **filename** = ``""`` :ref:`🔗<class_GLTFState_property_filename>`
  220. .. rst-class:: classref-property-setget
  221. - |void| **set_filename**\ (\ value\: :ref:`String<class_String>`\ )
  222. - :ref:`String<class_String>` **get_filename**\ (\ )
  223. The file name associated with this glTF data. If it ends with ``.gltf``, this is text-based glTF, otherwise this is binary GLB. This will be set during import when appending from a file, and will be set during export when writing to a file. If writing to a buffer, this will be an empty string.
  224. .. rst-class:: classref-item-separator
  225. ----
  226. .. _class_GLTFState_property_glb_data:
  227. .. rst-class:: classref-property
  228. :ref:`PackedByteArray<class_PackedByteArray>` **glb_data** = ``PackedByteArray()`` :ref:`🔗<class_GLTFState_property_glb_data>`
  229. .. rst-class:: classref-property-setget
  230. - |void| **set_glb_data**\ (\ value\: :ref:`PackedByteArray<class_PackedByteArray>`\ )
  231. - :ref:`PackedByteArray<class_PackedByteArray>` **get_glb_data**\ (\ )
  232. The binary buffer attached to a .glb file.
  233. **Note:** The returned array is *copied* and any changes to it will not update the original property value. See :ref:`PackedByteArray<class_PackedByteArray>` for more details.
  234. .. rst-class:: classref-item-separator
  235. ----
  236. .. _class_GLTFState_property_import_as_skeleton_bones:
  237. .. rst-class:: classref-property
  238. :ref:`bool<class_bool>` **import_as_skeleton_bones** = ``false`` :ref:`🔗<class_GLTFState_property_import_as_skeleton_bones>`
  239. .. rst-class:: classref-property-setget
  240. - |void| **set_import_as_skeleton_bones**\ (\ value\: :ref:`bool<class_bool>`\ )
  241. - :ref:`bool<class_bool>` **get_import_as_skeleton_bones**\ (\ )
  242. If ``true``, forces all GLTFNodes in the document to be bones of a single :ref:`Skeleton3D<class_Skeleton3D>` Godot node.
  243. .. rst-class:: classref-item-separator
  244. ----
  245. .. _class_GLTFState_property_json:
  246. .. rst-class:: classref-property
  247. :ref:`Dictionary<class_Dictionary>` **json** = ``{}`` :ref:`🔗<class_GLTFState_property_json>`
  248. .. rst-class:: classref-property-setget
  249. - |void| **set_json**\ (\ value\: :ref:`Dictionary<class_Dictionary>`\ )
  250. - :ref:`Dictionary<class_Dictionary>` **get_json**\ (\ )
  251. The original raw JSON document corresponding to this GLTFState.
  252. .. rst-class:: classref-item-separator
  253. ----
  254. .. _class_GLTFState_property_major_version:
  255. .. rst-class:: classref-property
  256. :ref:`int<class_int>` **major_version** = ``0`` :ref:`🔗<class_GLTFState_property_major_version>`
  257. .. rst-class:: classref-property-setget
  258. - |void| **set_major_version**\ (\ value\: :ref:`int<class_int>`\ )
  259. - :ref:`int<class_int>` **get_major_version**\ (\ )
  260. .. container:: contribute
  261. There is currently no description for this property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  262. .. rst-class:: classref-item-separator
  263. ----
  264. .. _class_GLTFState_property_minor_version:
  265. .. rst-class:: classref-property
  266. :ref:`int<class_int>` **minor_version** = ``0`` :ref:`🔗<class_GLTFState_property_minor_version>`
  267. .. rst-class:: classref-property-setget
  268. - |void| **set_minor_version**\ (\ value\: :ref:`int<class_int>`\ )
  269. - :ref:`int<class_int>` **get_minor_version**\ (\ )
  270. .. container:: contribute
  271. There is currently no description for this property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  272. .. rst-class:: classref-item-separator
  273. ----
  274. .. _class_GLTFState_property_root_nodes:
  275. .. rst-class:: classref-property
  276. :ref:`PackedInt32Array<class_PackedInt32Array>` **root_nodes** = ``PackedInt32Array()`` :ref:`🔗<class_GLTFState_property_root_nodes>`
  277. .. rst-class:: classref-property-setget
  278. - |void| **set_root_nodes**\ (\ value\: :ref:`PackedInt32Array<class_PackedInt32Array>`\ )
  279. - :ref:`PackedInt32Array<class_PackedInt32Array>` **get_root_nodes**\ (\ )
  280. The root nodes of the glTF file. Typically, a glTF file will only have one scene, and therefore one root node. However, a glTF file may have multiple scenes and therefore multiple root nodes, which will be generated as siblings of each other and as children of the root node of the generated Godot scene.
  281. **Note:** The returned array is *copied* and any changes to it will not update the original property value. See :ref:`PackedInt32Array<class_PackedInt32Array>` for more details.
  282. .. rst-class:: classref-item-separator
  283. ----
  284. .. _class_GLTFState_property_scene_name:
  285. .. rst-class:: classref-property
  286. :ref:`String<class_String>` **scene_name** = ``""`` :ref:`🔗<class_GLTFState_property_scene_name>`
  287. .. rst-class:: classref-property-setget
  288. - |void| **set_scene_name**\ (\ value\: :ref:`String<class_String>`\ )
  289. - :ref:`String<class_String>` **get_scene_name**\ (\ )
  290. The name of the scene. When importing, if not specified, this will be the file name. When exporting, if specified, the scene name will be saved to the glTF file.
  291. .. rst-class:: classref-item-separator
  292. ----
  293. .. _class_GLTFState_property_use_named_skin_binds:
  294. .. rst-class:: classref-property
  295. :ref:`bool<class_bool>` **use_named_skin_binds** = ``false`` :ref:`🔗<class_GLTFState_property_use_named_skin_binds>`
  296. .. rst-class:: classref-property-setget
  297. - |void| **set_use_named_skin_binds**\ (\ value\: :ref:`bool<class_bool>`\ )
  298. - :ref:`bool<class_bool>` **get_use_named_skin_binds**\ (\ )
  299. .. container:: contribute
  300. There is currently no description for this property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  301. .. rst-class:: classref-section-separator
  302. ----
  303. .. rst-class:: classref-descriptions-group
  304. Method Descriptions
  305. -------------------
  306. .. _class_GLTFState_method_add_used_extension:
  307. .. rst-class:: classref-method
  308. |void| **add_used_extension**\ (\ extension_name\: :ref:`String<class_String>`, required\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_GLTFState_method_add_used_extension>`
  309. Appends an extension to the list of extensions used by this glTF file during serialization. If ``required`` is ``true``, the extension will also be added to the list of required extensions. Do not run this in :ref:`GLTFDocumentExtension._export_post<class_GLTFDocumentExtension_private_method__export_post>`, as that stage is too late to add extensions. The final list is sorted alphabetically.
  310. .. rst-class:: classref-item-separator
  311. ----
  312. .. _class_GLTFState_method_append_data_to_buffers:
  313. .. rst-class:: classref-method
  314. :ref:`int<class_int>` **append_data_to_buffers**\ (\ data\: :ref:`PackedByteArray<class_PackedByteArray>`, deduplication\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_GLTFState_method_append_data_to_buffers>`
  315. Appends the given byte array data to the buffers and creates a :ref:`GLTFBufferView<class_GLTFBufferView>` for it. The index of the destination :ref:`GLTFBufferView<class_GLTFBufferView>` is returned. If ``deduplication`` is ``true``, the buffers will first be searched for duplicate data, otherwise new bytes will always be appended.
  316. .. rst-class:: classref-item-separator
  317. ----
  318. .. _class_GLTFState_method_append_gltf_node:
  319. .. rst-class:: classref-method
  320. :ref:`int<class_int>` **append_gltf_node**\ (\ gltf_node\: :ref:`GLTFNode<class_GLTFNode>`, godot_scene_node\: :ref:`Node<class_Node>`, parent_node_index\: :ref:`int<class_int>`\ ) :ref:`🔗<class_GLTFState_method_append_gltf_node>`
  321. Append the given :ref:`GLTFNode<class_GLTFNode>` to the state, and return its new index. This can be used to export one Godot node as multiple glTF nodes, or inject new glTF nodes at import time. On import, this must be called before :ref:`GLTFDocumentExtension._generate_scene_node<class_GLTFDocumentExtension_private_method__generate_scene_node>` finishes for the parent node. On export, this must be called before :ref:`GLTFDocumentExtension._export_node<class_GLTFDocumentExtension_private_method__export_node>` runs for the parent node.
  322. The ``godot_scene_node`` parameter is the Godot scene node that corresponds to this glTF node. This is highly recommended to be set to a valid node, but may be ``null`` if there is no corresponding Godot scene node. One Godot scene node may be used for multiple glTF nodes, so if exporting multiple glTF nodes for one Godot scene node, use the same Godot scene node for each.
  323. The ``parent_node_index`` parameter is the index of the parent :ref:`GLTFNode<class_GLTFNode>` in the state. If ``-1``, the node will be a root node, otherwise the new node will be added to the parent's list of children. The index will also be written to the :ref:`GLTFNode.parent<class_GLTFNode_property_parent>` property of the new node.
  324. .. rst-class:: classref-item-separator
  325. ----
  326. .. _class_GLTFState_method_get_accessors:
  327. .. rst-class:: classref-method
  328. :ref:`Array<class_Array>`\[:ref:`GLTFAccessor<class_GLTFAccessor>`\] **get_accessors**\ (\ ) :ref:`🔗<class_GLTFState_method_get_accessors>`
  329. .. container:: contribute
  330. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  331. .. rst-class:: classref-item-separator
  332. ----
  333. .. _class_GLTFState_method_get_additional_data:
  334. .. rst-class:: classref-method
  335. :ref:`Variant<class_Variant>` **get_additional_data**\ (\ extension_name\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_GLTFState_method_get_additional_data>`
  336. Gets additional arbitrary data in this **GLTFState** instance. This can be used to keep per-file state data in :ref:`GLTFDocumentExtension<class_GLTFDocumentExtension>` classes, which is important because they are stateless.
  337. The argument should be the :ref:`GLTFDocumentExtension<class_GLTFDocumentExtension>` name (does not have to match the extension name in the glTF file), and the return value can be anything you set. If nothing was set, the return value is ``null``.
  338. .. rst-class:: classref-item-separator
  339. ----
  340. .. _class_GLTFState_method_get_animation_player:
  341. .. rst-class:: classref-method
  342. :ref:`AnimationPlayer<class_AnimationPlayer>` **get_animation_player**\ (\ idx\: :ref:`int<class_int>`\ ) :ref:`🔗<class_GLTFState_method_get_animation_player>`
  343. Returns the :ref:`AnimationPlayer<class_AnimationPlayer>` node with the given index. These nodes are only used during the export process when converting Godot :ref:`AnimationPlayer<class_AnimationPlayer>` nodes to glTF animations.
  344. .. rst-class:: classref-item-separator
  345. ----
  346. .. _class_GLTFState_method_get_animation_players_count:
  347. .. rst-class:: classref-method
  348. :ref:`int<class_int>` **get_animation_players_count**\ (\ idx\: :ref:`int<class_int>`\ ) :ref:`🔗<class_GLTFState_method_get_animation_players_count>`
  349. Returns the number of :ref:`AnimationPlayer<class_AnimationPlayer>` nodes in this **GLTFState**. These nodes are only used during the export process when converting Godot :ref:`AnimationPlayer<class_AnimationPlayer>` nodes to glTF animations.
  350. .. rst-class:: classref-item-separator
  351. ----
  352. .. _class_GLTFState_method_get_animations:
  353. .. rst-class:: classref-method
  354. :ref:`Array<class_Array>`\[:ref:`GLTFAnimation<class_GLTFAnimation>`\] **get_animations**\ (\ ) :ref:`🔗<class_GLTFState_method_get_animations>`
  355. Returns an array of all :ref:`GLTFAnimation<class_GLTFAnimation>`\ s in the glTF file. When importing, these will be generated as animations in an :ref:`AnimationPlayer<class_AnimationPlayer>` node. When exporting, these will be generated from Godot :ref:`AnimationPlayer<class_AnimationPlayer>` nodes.
  356. .. rst-class:: classref-item-separator
  357. ----
  358. .. _class_GLTFState_method_get_buffer_views:
  359. .. rst-class:: classref-method
  360. :ref:`Array<class_Array>`\[:ref:`GLTFBufferView<class_GLTFBufferView>`\] **get_buffer_views**\ (\ ) :ref:`🔗<class_GLTFState_method_get_buffer_views>`
  361. .. container:: contribute
  362. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  363. .. rst-class:: classref-item-separator
  364. ----
  365. .. _class_GLTFState_method_get_cameras:
  366. .. rst-class:: classref-method
  367. :ref:`Array<class_Array>`\[:ref:`GLTFCamera<class_GLTFCamera>`\] **get_cameras**\ (\ ) :ref:`🔗<class_GLTFState_method_get_cameras>`
  368. Returns an array of all :ref:`GLTFCamera<class_GLTFCamera>`\ s in the glTF file. These are the cameras that the :ref:`GLTFNode.camera<class_GLTFNode_property_camera>` index refers to.
  369. .. rst-class:: classref-item-separator
  370. ----
  371. .. _class_GLTFState_method_get_handle_binary_image:
  372. .. rst-class:: classref-method
  373. :ref:`int<class_int>` **get_handle_binary_image**\ (\ ) :ref:`🔗<class_GLTFState_method_get_handle_binary_image>`
  374. .. container:: contribute
  375. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  376. .. rst-class:: classref-item-separator
  377. ----
  378. .. _class_GLTFState_method_get_images:
  379. .. rst-class:: classref-method
  380. :ref:`Array<class_Array>`\[:ref:`Texture2D<class_Texture2D>`\] **get_images**\ (\ ) :ref:`🔗<class_GLTFState_method_get_images>`
  381. Gets the images of the glTF file as an array of :ref:`Texture2D<class_Texture2D>`\ s. These are the images that the :ref:`GLTFTexture.src_image<class_GLTFTexture_property_src_image>` index refers to.
  382. .. rst-class:: classref-item-separator
  383. ----
  384. .. _class_GLTFState_method_get_lights:
  385. .. rst-class:: classref-method
  386. :ref:`Array<class_Array>`\[:ref:`GLTFLight<class_GLTFLight>`\] **get_lights**\ (\ ) :ref:`🔗<class_GLTFState_method_get_lights>`
  387. Returns an array of all :ref:`GLTFLight<class_GLTFLight>`\ s in the glTF file. These are the lights that the :ref:`GLTFNode.light<class_GLTFNode_property_light>` index refers to.
  388. .. rst-class:: classref-item-separator
  389. ----
  390. .. _class_GLTFState_method_get_materials:
  391. .. rst-class:: classref-method
  392. :ref:`Array<class_Array>`\[:ref:`Material<class_Material>`\] **get_materials**\ (\ ) :ref:`🔗<class_GLTFState_method_get_materials>`
  393. .. container:: contribute
  394. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  395. .. rst-class:: classref-item-separator
  396. ----
  397. .. _class_GLTFState_method_get_meshes:
  398. .. rst-class:: classref-method
  399. :ref:`Array<class_Array>`\[:ref:`GLTFMesh<class_GLTFMesh>`\] **get_meshes**\ (\ ) :ref:`🔗<class_GLTFState_method_get_meshes>`
  400. Returns an array of all :ref:`GLTFMesh<class_GLTFMesh>`\ es in the glTF file. These are the meshes that the :ref:`GLTFNode.mesh<class_GLTFNode_property_mesh>` index refers to.
  401. .. rst-class:: classref-item-separator
  402. ----
  403. .. _class_GLTFState_method_get_node_index:
  404. .. rst-class:: classref-method
  405. :ref:`int<class_int>` **get_node_index**\ (\ scene_node\: :ref:`Node<class_Node>`\ ) :ref:`🔗<class_GLTFState_method_get_node_index>`
  406. Returns the index of the :ref:`GLTFNode<class_GLTFNode>` corresponding to this Godot scene node. This is the inverse of :ref:`get_scene_node<class_GLTFState_method_get_scene_node>`. Useful during the export process.
  407. \ **Note:** Not every Godot scene node will have a corresponding :ref:`GLTFNode<class_GLTFNode>`, and not every :ref:`GLTFNode<class_GLTFNode>` will have a scene node generated. If there is no :ref:`GLTFNode<class_GLTFNode>` index for this scene node, ``-1`` is returned.
  408. .. rst-class:: classref-item-separator
  409. ----
  410. .. _class_GLTFState_method_get_nodes:
  411. .. rst-class:: classref-method
  412. :ref:`Array<class_Array>`\[:ref:`GLTFNode<class_GLTFNode>`\] **get_nodes**\ (\ ) :ref:`🔗<class_GLTFState_method_get_nodes>`
  413. Returns an array of all :ref:`GLTFNode<class_GLTFNode>`\ s in the glTF file. These are the nodes that :ref:`GLTFNode.children<class_GLTFNode_property_children>` and :ref:`root_nodes<class_GLTFState_property_root_nodes>` refer to. This includes nodes that may not be generated in the Godot scene, or nodes that may generate multiple Godot scene nodes.
  414. .. rst-class:: classref-item-separator
  415. ----
  416. .. _class_GLTFState_method_get_scene_node:
  417. .. rst-class:: classref-method
  418. :ref:`Node<class_Node>` **get_scene_node**\ (\ idx\: :ref:`int<class_int>`\ ) :ref:`🔗<class_GLTFState_method_get_scene_node>`
  419. Returns the Godot scene node that corresponds to the same index as the :ref:`GLTFNode<class_GLTFNode>` it was generated from. This is the inverse of :ref:`get_node_index<class_GLTFState_method_get_node_index>`. Useful during the import process.
  420. \ **Note:** Not every :ref:`GLTFNode<class_GLTFNode>` will have a scene node generated, and not every generated scene node will have a corresponding :ref:`GLTFNode<class_GLTFNode>`. If there is no scene node for this :ref:`GLTFNode<class_GLTFNode>` index, ``null`` is returned.
  421. .. rst-class:: classref-item-separator
  422. ----
  423. .. _class_GLTFState_method_get_skeletons:
  424. .. rst-class:: classref-method
  425. :ref:`Array<class_Array>`\[:ref:`GLTFSkeleton<class_GLTFSkeleton>`\] **get_skeletons**\ (\ ) :ref:`🔗<class_GLTFState_method_get_skeletons>`
  426. Returns an array of all :ref:`GLTFSkeleton<class_GLTFSkeleton>`\ s in the glTF file. These are the skeletons that the :ref:`GLTFNode.skeleton<class_GLTFNode_property_skeleton>` index refers to.
  427. .. rst-class:: classref-item-separator
  428. ----
  429. .. _class_GLTFState_method_get_skins:
  430. .. rst-class:: classref-method
  431. :ref:`Array<class_Array>`\[:ref:`GLTFSkin<class_GLTFSkin>`\] **get_skins**\ (\ ) :ref:`🔗<class_GLTFState_method_get_skins>`
  432. Returns an array of all :ref:`GLTFSkin<class_GLTFSkin>`\ s in the glTF file. These are the skins that the :ref:`GLTFNode.skin<class_GLTFNode_property_skin>` index refers to.
  433. .. rst-class:: classref-item-separator
  434. ----
  435. .. _class_GLTFState_method_get_texture_samplers:
  436. .. rst-class:: classref-method
  437. :ref:`Array<class_Array>`\[:ref:`GLTFTextureSampler<class_GLTFTextureSampler>`\] **get_texture_samplers**\ (\ ) :ref:`🔗<class_GLTFState_method_get_texture_samplers>`
  438. Retrieves the array of texture samplers that are used by the textures contained in the glTF.
  439. .. rst-class:: classref-item-separator
  440. ----
  441. .. _class_GLTFState_method_get_textures:
  442. .. rst-class:: classref-method
  443. :ref:`Array<class_Array>`\[:ref:`GLTFTexture<class_GLTFTexture>`\] **get_textures**\ (\ ) :ref:`🔗<class_GLTFState_method_get_textures>`
  444. .. container:: contribute
  445. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  446. .. rst-class:: classref-item-separator
  447. ----
  448. .. _class_GLTFState_method_get_unique_animation_names:
  449. .. rst-class:: classref-method
  450. :ref:`Array<class_Array>`\[:ref:`String<class_String>`\] **get_unique_animation_names**\ (\ ) :ref:`🔗<class_GLTFState_method_get_unique_animation_names>`
  451. Returns an array of unique animation names. This is only used during the import process.
  452. .. rst-class:: classref-item-separator
  453. ----
  454. .. _class_GLTFState_method_get_unique_names:
  455. .. rst-class:: classref-method
  456. :ref:`Array<class_Array>`\[:ref:`String<class_String>`\] **get_unique_names**\ (\ ) :ref:`🔗<class_GLTFState_method_get_unique_names>`
  457. Returns an array of unique node names. This is used in both the import process and export process.
  458. .. rst-class:: classref-item-separator
  459. ----
  460. .. _class_GLTFState_method_set_accessors:
  461. .. rst-class:: classref-method
  462. |void| **set_accessors**\ (\ accessors\: :ref:`Array<class_Array>`\[:ref:`GLTFAccessor<class_GLTFAccessor>`\]\ ) :ref:`🔗<class_GLTFState_method_set_accessors>`
  463. .. container:: contribute
  464. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  465. .. rst-class:: classref-item-separator
  466. ----
  467. .. _class_GLTFState_method_set_additional_data:
  468. .. rst-class:: classref-method
  469. |void| **set_additional_data**\ (\ extension_name\: :ref:`StringName<class_StringName>`, additional_data\: :ref:`Variant<class_Variant>`\ ) :ref:`🔗<class_GLTFState_method_set_additional_data>`
  470. Sets additional arbitrary data in this **GLTFState** instance. This can be used to keep per-file state data in :ref:`GLTFDocumentExtension<class_GLTFDocumentExtension>` classes, which is important because they are stateless.
  471. The first argument should be the :ref:`GLTFDocumentExtension<class_GLTFDocumentExtension>` name (does not have to match the extension name in the glTF file), and the second argument can be anything you want.
  472. .. rst-class:: classref-item-separator
  473. ----
  474. .. _class_GLTFState_method_set_animations:
  475. .. rst-class:: classref-method
  476. |void| **set_animations**\ (\ animations\: :ref:`Array<class_Array>`\[:ref:`GLTFAnimation<class_GLTFAnimation>`\]\ ) :ref:`🔗<class_GLTFState_method_set_animations>`
  477. Sets the :ref:`GLTFAnimation<class_GLTFAnimation>`\ s in the state. When importing, these will be generated as animations in an :ref:`AnimationPlayer<class_AnimationPlayer>` node. When exporting, these will be generated from Godot :ref:`AnimationPlayer<class_AnimationPlayer>` nodes.
  478. .. rst-class:: classref-item-separator
  479. ----
  480. .. _class_GLTFState_method_set_buffer_views:
  481. .. rst-class:: classref-method
  482. |void| **set_buffer_views**\ (\ buffer_views\: :ref:`Array<class_Array>`\[:ref:`GLTFBufferView<class_GLTFBufferView>`\]\ ) :ref:`🔗<class_GLTFState_method_set_buffer_views>`
  483. .. container:: contribute
  484. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  485. .. rst-class:: classref-item-separator
  486. ----
  487. .. _class_GLTFState_method_set_cameras:
  488. .. rst-class:: classref-method
  489. |void| **set_cameras**\ (\ cameras\: :ref:`Array<class_Array>`\[:ref:`GLTFCamera<class_GLTFCamera>`\]\ ) :ref:`🔗<class_GLTFState_method_set_cameras>`
  490. Sets the :ref:`GLTFCamera<class_GLTFCamera>`\ s in the state. These are the cameras that the :ref:`GLTFNode.camera<class_GLTFNode_property_camera>` index refers to.
  491. .. rst-class:: classref-item-separator
  492. ----
  493. .. _class_GLTFState_method_set_handle_binary_image:
  494. .. rst-class:: classref-method
  495. |void| **set_handle_binary_image**\ (\ method\: :ref:`int<class_int>`\ ) :ref:`🔗<class_GLTFState_method_set_handle_binary_image>`
  496. .. container:: contribute
  497. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  498. .. rst-class:: classref-item-separator
  499. ----
  500. .. _class_GLTFState_method_set_images:
  501. .. rst-class:: classref-method
  502. |void| **set_images**\ (\ images\: :ref:`Array<class_Array>`\[:ref:`Texture2D<class_Texture2D>`\]\ ) :ref:`🔗<class_GLTFState_method_set_images>`
  503. Sets the images in the state stored as an array of :ref:`Texture2D<class_Texture2D>`\ s. This can be used during export. These are the images that the :ref:`GLTFTexture.src_image<class_GLTFTexture_property_src_image>` index refers to.
  504. .. rst-class:: classref-item-separator
  505. ----
  506. .. _class_GLTFState_method_set_lights:
  507. .. rst-class:: classref-method
  508. |void| **set_lights**\ (\ lights\: :ref:`Array<class_Array>`\[:ref:`GLTFLight<class_GLTFLight>`\]\ ) :ref:`🔗<class_GLTFState_method_set_lights>`
  509. Sets the :ref:`GLTFLight<class_GLTFLight>`\ s in the state. These are the lights that the :ref:`GLTFNode.light<class_GLTFNode_property_light>` index refers to.
  510. .. rst-class:: classref-item-separator
  511. ----
  512. .. _class_GLTFState_method_set_materials:
  513. .. rst-class:: classref-method
  514. |void| **set_materials**\ (\ materials\: :ref:`Array<class_Array>`\[:ref:`Material<class_Material>`\]\ ) :ref:`🔗<class_GLTFState_method_set_materials>`
  515. .. container:: contribute
  516. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  517. .. rst-class:: classref-item-separator
  518. ----
  519. .. _class_GLTFState_method_set_meshes:
  520. .. rst-class:: classref-method
  521. |void| **set_meshes**\ (\ meshes\: :ref:`Array<class_Array>`\[:ref:`GLTFMesh<class_GLTFMesh>`\]\ ) :ref:`🔗<class_GLTFState_method_set_meshes>`
  522. Sets the :ref:`GLTFMesh<class_GLTFMesh>`\ es in the state. These are the meshes that the :ref:`GLTFNode.mesh<class_GLTFNode_property_mesh>` index refers to.
  523. .. rst-class:: classref-item-separator
  524. ----
  525. .. _class_GLTFState_method_set_nodes:
  526. .. rst-class:: classref-method
  527. |void| **set_nodes**\ (\ nodes\: :ref:`Array<class_Array>`\[:ref:`GLTFNode<class_GLTFNode>`\]\ ) :ref:`🔗<class_GLTFState_method_set_nodes>`
  528. Sets the :ref:`GLTFNode<class_GLTFNode>`\ s in the state. These are the nodes that :ref:`GLTFNode.children<class_GLTFNode_property_children>` and :ref:`root_nodes<class_GLTFState_property_root_nodes>` refer to. Some of the nodes set here may not be generated in the Godot scene, or may generate multiple Godot scene nodes.
  529. .. rst-class:: classref-item-separator
  530. ----
  531. .. _class_GLTFState_method_set_skeletons:
  532. .. rst-class:: classref-method
  533. |void| **set_skeletons**\ (\ skeletons\: :ref:`Array<class_Array>`\[:ref:`GLTFSkeleton<class_GLTFSkeleton>`\]\ ) :ref:`🔗<class_GLTFState_method_set_skeletons>`
  534. Sets the :ref:`GLTFSkeleton<class_GLTFSkeleton>`\ s in the state. These are the skeletons that the :ref:`GLTFNode.skeleton<class_GLTFNode_property_skeleton>` index refers to.
  535. .. rst-class:: classref-item-separator
  536. ----
  537. .. _class_GLTFState_method_set_skins:
  538. .. rst-class:: classref-method
  539. |void| **set_skins**\ (\ skins\: :ref:`Array<class_Array>`\[:ref:`GLTFSkin<class_GLTFSkin>`\]\ ) :ref:`🔗<class_GLTFState_method_set_skins>`
  540. Sets the :ref:`GLTFSkin<class_GLTFSkin>`\ s in the state. These are the skins that the :ref:`GLTFNode.skin<class_GLTFNode_property_skin>` index refers to.
  541. .. rst-class:: classref-item-separator
  542. ----
  543. .. _class_GLTFState_method_set_texture_samplers:
  544. .. rst-class:: classref-method
  545. |void| **set_texture_samplers**\ (\ texture_samplers\: :ref:`Array<class_Array>`\[:ref:`GLTFTextureSampler<class_GLTFTextureSampler>`\]\ ) :ref:`🔗<class_GLTFState_method_set_texture_samplers>`
  546. Sets the array of texture samplers that are used by the textures contained in the glTF.
  547. .. rst-class:: classref-item-separator
  548. ----
  549. .. _class_GLTFState_method_set_textures:
  550. .. rst-class:: classref-method
  551. |void| **set_textures**\ (\ textures\: :ref:`Array<class_Array>`\[:ref:`GLTFTexture<class_GLTFTexture>`\]\ ) :ref:`🔗<class_GLTFState_method_set_textures>`
  552. .. container:: contribute
  553. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  554. .. rst-class:: classref-item-separator
  555. ----
  556. .. _class_GLTFState_method_set_unique_animation_names:
  557. .. rst-class:: classref-method
  558. |void| **set_unique_animation_names**\ (\ unique_animation_names\: :ref:`Array<class_Array>`\[:ref:`String<class_String>`\]\ ) :ref:`🔗<class_GLTFState_method_set_unique_animation_names>`
  559. Sets the unique animation names in the state. This is only used during the import process.
  560. .. rst-class:: classref-item-separator
  561. ----
  562. .. _class_GLTFState_method_set_unique_names:
  563. .. rst-class:: classref-method
  564. |void| **set_unique_names**\ (\ unique_names\: :ref:`Array<class_Array>`\[:ref:`String<class_String>`\]\ ) :ref:`🔗<class_GLTFState_method_set_unique_names>`
  565. Sets the unique node names in the state. This is used in both the import process and export process.
  566. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  567. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  568. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  569. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  570. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  571. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  572. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  573. .. |void| replace:: :abbr:`void (No return value.)`