class_gltfstate.rst 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869
  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/4.0/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.0/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. Represents all data of a GLTF file.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. 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.
  15. 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.
  16. .. rst-class:: classref-reftable-group
  17. Properties
  18. ----------
  19. .. table::
  20. :widths: auto
  21. +-------------------------------------------------+----------------------------------------------------------------------------+------------------------+
  22. | :ref:`String<class_String>` | :ref:`base_path<class_GLTFState_property_base_path>` | ``""`` |
  23. +-------------------------------------------------+----------------------------------------------------------------------------+------------------------+
  24. | :ref:`PackedByteArray[]<class_PackedByteArray>` | :ref:`buffers<class_GLTFState_property_buffers>` | ``[]`` |
  25. +-------------------------------------------------+----------------------------------------------------------------------------+------------------------+
  26. | :ref:`bool<class_bool>` | :ref:`create_animations<class_GLTFState_property_create_animations>` | ``true`` |
  27. +-------------------------------------------------+----------------------------------------------------------------------------+------------------------+
  28. | :ref:`PackedByteArray<class_PackedByteArray>` | :ref:`glb_data<class_GLTFState_property_glb_data>` | ``PackedByteArray()`` |
  29. +-------------------------------------------------+----------------------------------------------------------------------------+------------------------+
  30. | :ref:`Dictionary<class_Dictionary>` | :ref:`json<class_GLTFState_property_json>` | ``{}`` |
  31. +-------------------------------------------------+----------------------------------------------------------------------------+------------------------+
  32. | :ref:`int<class_int>` | :ref:`major_version<class_GLTFState_property_major_version>` | ``0`` |
  33. +-------------------------------------------------+----------------------------------------------------------------------------+------------------------+
  34. | :ref:`int<class_int>` | :ref:`minor_version<class_GLTFState_property_minor_version>` | ``0`` |
  35. +-------------------------------------------------+----------------------------------------------------------------------------+------------------------+
  36. | :ref:`PackedInt32Array<class_PackedInt32Array>` | :ref:`root_nodes<class_GLTFState_property_root_nodes>` | ``PackedInt32Array()`` |
  37. +-------------------------------------------------+----------------------------------------------------------------------------+------------------------+
  38. | :ref:`String<class_String>` | :ref:`scene_name<class_GLTFState_property_scene_name>` | ``""`` |
  39. +-------------------------------------------------+----------------------------------------------------------------------------+------------------------+
  40. | :ref:`bool<class_bool>` | :ref:`use_named_skin_binds<class_GLTFState_property_use_named_skin_binds>` | ``false`` |
  41. +-------------------------------------------------+----------------------------------------------------------------------------+------------------------+
  42. .. rst-class:: classref-reftable-group
  43. Methods
  44. -------
  45. .. table::
  46. :widths: auto
  47. +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | void | :ref:`add_used_extension<class_GLTFState_method_add_used_extension>` **(** :ref:`String<class_String>` extension_name, :ref:`bool<class_bool>` required **)** |
  49. +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | :ref:`GLTFAccessor[]<class_GLTFAccessor>` | :ref:`get_accessors<class_GLTFState_method_get_accessors>` **(** **)** |
  51. +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | :ref:`Variant<class_Variant>` | :ref:`get_additional_data<class_GLTFState_method_get_additional_data>` **(** :ref:`StringName<class_StringName>` extension_name **)** |
  53. +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  54. | :ref:`AnimationPlayer<class_AnimationPlayer>` | :ref:`get_animation_player<class_GLTFState_method_get_animation_player>` **(** :ref:`int<class_int>` idx **)** |
  55. +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  56. | :ref:`int<class_int>` | :ref:`get_animation_players_count<class_GLTFState_method_get_animation_players_count>` **(** :ref:`int<class_int>` idx **)** |
  57. +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | :ref:`GLTFAnimation[]<class_GLTFAnimation>` | :ref:`get_animations<class_GLTFState_method_get_animations>` **(** **)** |
  59. +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | :ref:`GLTFBufferView[]<class_GLTFBufferView>` | :ref:`get_buffer_views<class_GLTFState_method_get_buffer_views>` **(** **)** |
  61. +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | :ref:`GLTFCamera[]<class_GLTFCamera>` | :ref:`get_cameras<class_GLTFState_method_get_cameras>` **(** **)** |
  63. +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | :ref:`int<class_int>` | :ref:`get_handle_binary_image<class_GLTFState_method_get_handle_binary_image>` **(** **)** |
  65. +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | :ref:`Texture2D[]<class_Texture2D>` | :ref:`get_images<class_GLTFState_method_get_images>` **(** **)** |
  67. +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | :ref:`GLTFLight[]<class_GLTFLight>` | :ref:`get_lights<class_GLTFState_method_get_lights>` **(** **)** |
  69. +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | :ref:`Material[]<class_Material>` | :ref:`get_materials<class_GLTFState_method_get_materials>` **(** **)** |
  71. +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | :ref:`GLTFMesh[]<class_GLTFMesh>` | :ref:`get_meshes<class_GLTFState_method_get_meshes>` **(** **)** |
  73. +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | :ref:`GLTFNode[]<class_GLTFNode>` | :ref:`get_nodes<class_GLTFState_method_get_nodes>` **(** **)** |
  75. +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  76. | :ref:`Node<class_Node>` | :ref:`get_scene_node<class_GLTFState_method_get_scene_node>` **(** :ref:`int<class_int>` idx **)** |
  77. +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  78. | :ref:`GLTFSkeleton[]<class_GLTFSkeleton>` | :ref:`get_skeletons<class_GLTFState_method_get_skeletons>` **(** **)** |
  79. +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  80. | :ref:`GLTFSkin[]<class_GLTFSkin>` | :ref:`get_skins<class_GLTFState_method_get_skins>` **(** **)** |
  81. +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  82. | :ref:`GLTFTextureSampler[]<class_GLTFTextureSampler>` | :ref:`get_texture_samplers<class_GLTFState_method_get_texture_samplers>` **(** **)** |
  83. +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  84. | :ref:`GLTFTexture[]<class_GLTFTexture>` | :ref:`get_textures<class_GLTFState_method_get_textures>` **(** **)** |
  85. +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  86. | :ref:`String[]<class_String>` | :ref:`get_unique_animation_names<class_GLTFState_method_get_unique_animation_names>` **(** **)** |
  87. +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  88. | :ref:`String[]<class_String>` | :ref:`get_unique_names<class_GLTFState_method_get_unique_names>` **(** **)** |
  89. +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  90. | void | :ref:`set_accessors<class_GLTFState_method_set_accessors>` **(** :ref:`GLTFAccessor[]<class_GLTFAccessor>` accessors **)** |
  91. +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  92. | void | :ref:`set_additional_data<class_GLTFState_method_set_additional_data>` **(** :ref:`StringName<class_StringName>` extension_name, :ref:`Variant<class_Variant>` additional_data **)** |
  93. +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  94. | void | :ref:`set_animations<class_GLTFState_method_set_animations>` **(** :ref:`GLTFAnimation[]<class_GLTFAnimation>` animations **)** |
  95. +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  96. | void | :ref:`set_buffer_views<class_GLTFState_method_set_buffer_views>` **(** :ref:`GLTFBufferView[]<class_GLTFBufferView>` buffer_views **)** |
  97. +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  98. | void | :ref:`set_cameras<class_GLTFState_method_set_cameras>` **(** :ref:`GLTFCamera[]<class_GLTFCamera>` cameras **)** |
  99. +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  100. | void | :ref:`set_handle_binary_image<class_GLTFState_method_set_handle_binary_image>` **(** :ref:`int<class_int>` method **)** |
  101. +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  102. | void | :ref:`set_images<class_GLTFState_method_set_images>` **(** :ref:`Texture2D[]<class_Texture2D>` images **)** |
  103. +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  104. | void | :ref:`set_lights<class_GLTFState_method_set_lights>` **(** :ref:`GLTFLight[]<class_GLTFLight>` lights **)** |
  105. +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  106. | void | :ref:`set_materials<class_GLTFState_method_set_materials>` **(** :ref:`Material[]<class_Material>` materials **)** |
  107. +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  108. | void | :ref:`set_meshes<class_GLTFState_method_set_meshes>` **(** :ref:`GLTFMesh[]<class_GLTFMesh>` meshes **)** |
  109. +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  110. | void | :ref:`set_nodes<class_GLTFState_method_set_nodes>` **(** :ref:`GLTFNode[]<class_GLTFNode>` nodes **)** |
  111. +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  112. | void | :ref:`set_skeletons<class_GLTFState_method_set_skeletons>` **(** :ref:`GLTFSkeleton[]<class_GLTFSkeleton>` skeletons **)** |
  113. +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  114. | void | :ref:`set_skins<class_GLTFState_method_set_skins>` **(** :ref:`GLTFSkin[]<class_GLTFSkin>` skins **)** |
  115. +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  116. | void | :ref:`set_texture_samplers<class_GLTFState_method_set_texture_samplers>` **(** :ref:`GLTFTextureSampler[]<class_GLTFTextureSampler>` texture_samplers **)** |
  117. +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  118. | void | :ref:`set_textures<class_GLTFState_method_set_textures>` **(** :ref:`GLTFTexture[]<class_GLTFTexture>` textures **)** |
  119. +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  120. | void | :ref:`set_unique_animation_names<class_GLTFState_method_set_unique_animation_names>` **(** :ref:`String[]<class_String>` unique_animation_names **)** |
  121. +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  122. | void | :ref:`set_unique_names<class_GLTFState_method_set_unique_names>` **(** :ref:`String[]<class_String>` unique_names **)** |
  123. +-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  124. .. rst-class:: classref-section-separator
  125. ----
  126. .. rst-class:: classref-descriptions-group
  127. Constants
  128. ---------
  129. .. _class_GLTFState_constant_HANDLE_BINARY_DISCARD_TEXTURES:
  130. .. rst-class:: classref-constant
  131. **HANDLE_BINARY_DISCARD_TEXTURES** = ``0``
  132. Discards all embedded textures and uses untextured materials.
  133. .. _class_GLTFState_constant_HANDLE_BINARY_EXTRACT_TEXTURES:
  134. .. rst-class:: classref-constant
  135. **HANDLE_BINARY_EXTRACT_TEXTURES** = ``1``
  136. Extracts embedded textures to be reimported and compressed. Editor only. Acts as uncompressed at runtime.
  137. .. _class_GLTFState_constant_HANDLE_BINARY_EMBED_AS_BASISU:
  138. .. rst-class:: classref-constant
  139. **HANDLE_BINARY_EMBED_AS_BASISU** = ``2``
  140. Embeds textures VRAM compressed with Basis Universal into the generated scene.
  141. .. _class_GLTFState_constant_HANDLE_BINARY_EMBED_AS_UNCOMPRESSED:
  142. .. rst-class:: classref-constant
  143. **HANDLE_BINARY_EMBED_AS_UNCOMPRESSED** = ``3``
  144. Embeds textures compressed losslessly into the generated scene, matching old behavior.
  145. .. rst-class:: classref-section-separator
  146. ----
  147. .. rst-class:: classref-descriptions-group
  148. Property Descriptions
  149. ---------------------
  150. .. _class_GLTFState_property_base_path:
  151. .. rst-class:: classref-property
  152. :ref:`String<class_String>` **base_path** = ``""``
  153. .. rst-class:: classref-property-setget
  154. - void **set_base_path** **(** :ref:`String<class_String>` value **)**
  155. - :ref:`String<class_String>` **get_base_path** **(** **)**
  156. .. container:: contribute
  157. There is currently no description for this property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  158. .. rst-class:: classref-item-separator
  159. ----
  160. .. _class_GLTFState_property_buffers:
  161. .. rst-class:: classref-property
  162. :ref:`PackedByteArray[]<class_PackedByteArray>` **buffers** = ``[]``
  163. .. rst-class:: classref-property-setget
  164. - void **set_buffers** **(** :ref:`PackedByteArray[]<class_PackedByteArray>` value **)**
  165. - :ref:`PackedByteArray[]<class_PackedByteArray>` **get_buffers** **(** **)**
  166. .. container:: contribute
  167. There is currently no description for this property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  168. .. rst-class:: classref-item-separator
  169. ----
  170. .. _class_GLTFState_property_create_animations:
  171. .. rst-class:: classref-property
  172. :ref:`bool<class_bool>` **create_animations** = ``true``
  173. .. rst-class:: classref-property-setget
  174. - void **set_create_animations** **(** :ref:`bool<class_bool>` value **)**
  175. - :ref:`bool<class_bool>` **get_create_animations** **(** **)**
  176. .. container:: contribute
  177. There is currently no description for this property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  178. .. rst-class:: classref-item-separator
  179. ----
  180. .. _class_GLTFState_property_glb_data:
  181. .. rst-class:: classref-property
  182. :ref:`PackedByteArray<class_PackedByteArray>` **glb_data** = ``PackedByteArray()``
  183. .. rst-class:: classref-property-setget
  184. - void **set_glb_data** **(** :ref:`PackedByteArray<class_PackedByteArray>` value **)**
  185. - :ref:`PackedByteArray<class_PackedByteArray>` **get_glb_data** **(** **)**
  186. .. container:: contribute
  187. There is currently no description for this property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  188. .. rst-class:: classref-item-separator
  189. ----
  190. .. _class_GLTFState_property_json:
  191. .. rst-class:: classref-property
  192. :ref:`Dictionary<class_Dictionary>` **json** = ``{}``
  193. .. rst-class:: classref-property-setget
  194. - void **set_json** **(** :ref:`Dictionary<class_Dictionary>` value **)**
  195. - :ref:`Dictionary<class_Dictionary>` **get_json** **(** **)**
  196. .. container:: contribute
  197. There is currently no description for this property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  198. .. rst-class:: classref-item-separator
  199. ----
  200. .. _class_GLTFState_property_major_version:
  201. .. rst-class:: classref-property
  202. :ref:`int<class_int>` **major_version** = ``0``
  203. .. rst-class:: classref-property-setget
  204. - void **set_major_version** **(** :ref:`int<class_int>` value **)**
  205. - :ref:`int<class_int>` **get_major_version** **(** **)**
  206. .. container:: contribute
  207. There is currently no description for this property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  208. .. rst-class:: classref-item-separator
  209. ----
  210. .. _class_GLTFState_property_minor_version:
  211. .. rst-class:: classref-property
  212. :ref:`int<class_int>` **minor_version** = ``0``
  213. .. rst-class:: classref-property-setget
  214. - void **set_minor_version** **(** :ref:`int<class_int>` value **)**
  215. - :ref:`int<class_int>` **get_minor_version** **(** **)**
  216. .. container:: contribute
  217. There is currently no description for this property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  218. .. rst-class:: classref-item-separator
  219. ----
  220. .. _class_GLTFState_property_root_nodes:
  221. .. rst-class:: classref-property
  222. :ref:`PackedInt32Array<class_PackedInt32Array>` **root_nodes** = ``PackedInt32Array()``
  223. .. rst-class:: classref-property-setget
  224. - void **set_root_nodes** **(** :ref:`PackedInt32Array<class_PackedInt32Array>` value **)**
  225. - :ref:`PackedInt32Array<class_PackedInt32Array>` **get_root_nodes** **(** **)**
  226. 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.
  227. .. rst-class:: classref-item-separator
  228. ----
  229. .. _class_GLTFState_property_scene_name:
  230. .. rst-class:: classref-property
  231. :ref:`String<class_String>` **scene_name** = ``""``
  232. .. rst-class:: classref-property-setget
  233. - void **set_scene_name** **(** :ref:`String<class_String>` value **)**
  234. - :ref:`String<class_String>` **get_scene_name** **(** **)**
  235. 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.
  236. .. rst-class:: classref-item-separator
  237. ----
  238. .. _class_GLTFState_property_use_named_skin_binds:
  239. .. rst-class:: classref-property
  240. :ref:`bool<class_bool>` **use_named_skin_binds** = ``false``
  241. .. rst-class:: classref-property-setget
  242. - void **set_use_named_skin_binds** **(** :ref:`bool<class_bool>` value **)**
  243. - :ref:`bool<class_bool>` **get_use_named_skin_binds** **(** **)**
  244. .. container:: contribute
  245. There is currently no description for this property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  246. .. rst-class:: classref-section-separator
  247. ----
  248. .. rst-class:: classref-descriptions-group
  249. Method Descriptions
  250. -------------------
  251. .. _class_GLTFState_method_add_used_extension:
  252. .. rst-class:: classref-method
  253. void **add_used_extension** **(** :ref:`String<class_String>` extension_name, :ref:`bool<class_bool>` required **)**
  254. 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_method__export_post>`, as that stage is too late to add extensions. The final list is sorted alphabetically.
  255. .. rst-class:: classref-item-separator
  256. ----
  257. .. _class_GLTFState_method_get_accessors:
  258. .. rst-class:: classref-method
  259. :ref:`GLTFAccessor[]<class_GLTFAccessor>` **get_accessors** **(** **)**
  260. .. container:: contribute
  261. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  262. .. rst-class:: classref-item-separator
  263. ----
  264. .. _class_GLTFState_method_get_additional_data:
  265. .. rst-class:: classref-method
  266. :ref:`Variant<class_Variant>` **get_additional_data** **(** :ref:`StringName<class_StringName>` extension_name **)**
  267. 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.
  268. 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.
  269. .. rst-class:: classref-item-separator
  270. ----
  271. .. _class_GLTFState_method_get_animation_player:
  272. .. rst-class:: classref-method
  273. :ref:`AnimationPlayer<class_AnimationPlayer>` **get_animation_player** **(** :ref:`int<class_int>` idx **)**
  274. 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.
  275. .. rst-class:: classref-item-separator
  276. ----
  277. .. _class_GLTFState_method_get_animation_players_count:
  278. .. rst-class:: classref-method
  279. :ref:`int<class_int>` **get_animation_players_count** **(** :ref:`int<class_int>` idx **)**
  280. 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.
  281. .. rst-class:: classref-item-separator
  282. ----
  283. .. _class_GLTFState_method_get_animations:
  284. .. rst-class:: classref-method
  285. :ref:`GLTFAnimation[]<class_GLTFAnimation>` **get_animations** **(** **)**
  286. 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.
  287. .. rst-class:: classref-item-separator
  288. ----
  289. .. _class_GLTFState_method_get_buffer_views:
  290. .. rst-class:: classref-method
  291. :ref:`GLTFBufferView[]<class_GLTFBufferView>` **get_buffer_views** **(** **)**
  292. .. container:: contribute
  293. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  294. .. rst-class:: classref-item-separator
  295. ----
  296. .. _class_GLTFState_method_get_cameras:
  297. .. rst-class:: classref-method
  298. :ref:`GLTFCamera[]<class_GLTFCamera>` **get_cameras** **(** **)**
  299. 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.
  300. .. rst-class:: classref-item-separator
  301. ----
  302. .. _class_GLTFState_method_get_handle_binary_image:
  303. .. rst-class:: classref-method
  304. :ref:`int<class_int>` **get_handle_binary_image** **(** **)**
  305. .. container:: contribute
  306. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  307. .. rst-class:: classref-item-separator
  308. ----
  309. .. _class_GLTFState_method_get_images:
  310. .. rst-class:: classref-method
  311. :ref:`Texture2D[]<class_Texture2D>` **get_images** **(** **)**
  312. .. container:: contribute
  313. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  314. .. rst-class:: classref-item-separator
  315. ----
  316. .. _class_GLTFState_method_get_lights:
  317. .. rst-class:: classref-method
  318. :ref:`GLTFLight[]<class_GLTFLight>` **get_lights** **(** **)**
  319. 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.
  320. .. rst-class:: classref-item-separator
  321. ----
  322. .. _class_GLTFState_method_get_materials:
  323. .. rst-class:: classref-method
  324. :ref:`Material[]<class_Material>` **get_materials** **(** **)**
  325. .. container:: contribute
  326. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  327. .. rst-class:: classref-item-separator
  328. ----
  329. .. _class_GLTFState_method_get_meshes:
  330. .. rst-class:: classref-method
  331. :ref:`GLTFMesh[]<class_GLTFMesh>` **get_meshes** **(** **)**
  332. 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.
  333. .. rst-class:: classref-item-separator
  334. ----
  335. .. _class_GLTFState_method_get_nodes:
  336. .. rst-class:: classref-method
  337. :ref:`GLTFNode[]<class_GLTFNode>` **get_nodes** **(** **)**
  338. 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.
  339. .. rst-class:: classref-item-separator
  340. ----
  341. .. _class_GLTFState_method_get_scene_node:
  342. .. rst-class:: classref-method
  343. :ref:`Node<class_Node>` **get_scene_node** **(** :ref:`int<class_int>` idx **)**
  344. Returns the Godot scene node that corresponds to the same index as the :ref:`GLTFNode<class_GLTFNode>` it was generated from. 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>`.
  345. .. rst-class:: classref-item-separator
  346. ----
  347. .. _class_GLTFState_method_get_skeletons:
  348. .. rst-class:: classref-method
  349. :ref:`GLTFSkeleton[]<class_GLTFSkeleton>` **get_skeletons** **(** **)**
  350. 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.
  351. .. rst-class:: classref-item-separator
  352. ----
  353. .. _class_GLTFState_method_get_skins:
  354. .. rst-class:: classref-method
  355. :ref:`GLTFSkin[]<class_GLTFSkin>` **get_skins** **(** **)**
  356. 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.
  357. .. rst-class:: classref-item-separator
  358. ----
  359. .. _class_GLTFState_method_get_texture_samplers:
  360. .. rst-class:: classref-method
  361. :ref:`GLTFTextureSampler[]<class_GLTFTextureSampler>` **get_texture_samplers** **(** **)**
  362. Retrieves the array of texture samplers that are used by the textures contained in the GLTF.
  363. .. rst-class:: classref-item-separator
  364. ----
  365. .. _class_GLTFState_method_get_textures:
  366. .. rst-class:: classref-method
  367. :ref:`GLTFTexture[]<class_GLTFTexture>` **get_textures** **(** **)**
  368. .. container:: contribute
  369. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  370. .. rst-class:: classref-item-separator
  371. ----
  372. .. _class_GLTFState_method_get_unique_animation_names:
  373. .. rst-class:: classref-method
  374. :ref:`String[]<class_String>` **get_unique_animation_names** **(** **)**
  375. Returns an array of unique animation names. This is only used during the import process.
  376. .. rst-class:: classref-item-separator
  377. ----
  378. .. _class_GLTFState_method_get_unique_names:
  379. .. rst-class:: classref-method
  380. :ref:`String[]<class_String>` **get_unique_names** **(** **)**
  381. Returns an array of unique node names. This is used in both the import process and export process.
  382. .. rst-class:: classref-item-separator
  383. ----
  384. .. _class_GLTFState_method_set_accessors:
  385. .. rst-class:: classref-method
  386. void **set_accessors** **(** :ref:`GLTFAccessor[]<class_GLTFAccessor>` accessors **)**
  387. .. container:: contribute
  388. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  389. .. rst-class:: classref-item-separator
  390. ----
  391. .. _class_GLTFState_method_set_additional_data:
  392. .. rst-class:: classref-method
  393. void **set_additional_data** **(** :ref:`StringName<class_StringName>` extension_name, :ref:`Variant<class_Variant>` additional_data **)**
  394. 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.
  395. 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.
  396. .. rst-class:: classref-item-separator
  397. ----
  398. .. _class_GLTFState_method_set_animations:
  399. .. rst-class:: classref-method
  400. void **set_animations** **(** :ref:`GLTFAnimation[]<class_GLTFAnimation>` animations **)**
  401. 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.
  402. .. rst-class:: classref-item-separator
  403. ----
  404. .. _class_GLTFState_method_set_buffer_views:
  405. .. rst-class:: classref-method
  406. void **set_buffer_views** **(** :ref:`GLTFBufferView[]<class_GLTFBufferView>` buffer_views **)**
  407. .. container:: contribute
  408. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  409. .. rst-class:: classref-item-separator
  410. ----
  411. .. _class_GLTFState_method_set_cameras:
  412. .. rst-class:: classref-method
  413. void **set_cameras** **(** :ref:`GLTFCamera[]<class_GLTFCamera>` cameras **)**
  414. 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.
  415. .. rst-class:: classref-item-separator
  416. ----
  417. .. _class_GLTFState_method_set_handle_binary_image:
  418. .. rst-class:: classref-method
  419. void **set_handle_binary_image** **(** :ref:`int<class_int>` method **)**
  420. .. container:: contribute
  421. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  422. .. rst-class:: classref-item-separator
  423. ----
  424. .. _class_GLTFState_method_set_images:
  425. .. rst-class:: classref-method
  426. void **set_images** **(** :ref:`Texture2D[]<class_Texture2D>` images **)**
  427. .. container:: contribute
  428. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  429. .. rst-class:: classref-item-separator
  430. ----
  431. .. _class_GLTFState_method_set_lights:
  432. .. rst-class:: classref-method
  433. void **set_lights** **(** :ref:`GLTFLight[]<class_GLTFLight>` lights **)**
  434. 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.
  435. .. rst-class:: classref-item-separator
  436. ----
  437. .. _class_GLTFState_method_set_materials:
  438. .. rst-class:: classref-method
  439. void **set_materials** **(** :ref:`Material[]<class_Material>` materials **)**
  440. .. container:: contribute
  441. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  442. .. rst-class:: classref-item-separator
  443. ----
  444. .. _class_GLTFState_method_set_meshes:
  445. .. rst-class:: classref-method
  446. void **set_meshes** **(** :ref:`GLTFMesh[]<class_GLTFMesh>` meshes **)**
  447. 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.
  448. .. rst-class:: classref-item-separator
  449. ----
  450. .. _class_GLTFState_method_set_nodes:
  451. .. rst-class:: classref-method
  452. void **set_nodes** **(** :ref:`GLTFNode[]<class_GLTFNode>` nodes **)**
  453. 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.
  454. .. rst-class:: classref-item-separator
  455. ----
  456. .. _class_GLTFState_method_set_skeletons:
  457. .. rst-class:: classref-method
  458. void **set_skeletons** **(** :ref:`GLTFSkeleton[]<class_GLTFSkeleton>` skeletons **)**
  459. 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.
  460. .. rst-class:: classref-item-separator
  461. ----
  462. .. _class_GLTFState_method_set_skins:
  463. .. rst-class:: classref-method
  464. void **set_skins** **(** :ref:`GLTFSkin[]<class_GLTFSkin>` skins **)**
  465. 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.
  466. .. rst-class:: classref-item-separator
  467. ----
  468. .. _class_GLTFState_method_set_texture_samplers:
  469. .. rst-class:: classref-method
  470. void **set_texture_samplers** **(** :ref:`GLTFTextureSampler[]<class_GLTFTextureSampler>` texture_samplers **)**
  471. Sets the array of texture samplers that are used by the textures contained in the GLTF.
  472. .. rst-class:: classref-item-separator
  473. ----
  474. .. _class_GLTFState_method_set_textures:
  475. .. rst-class:: classref-method
  476. void **set_textures** **(** :ref:`GLTFTexture[]<class_GLTFTexture>` textures **)**
  477. .. container:: contribute
  478. There is currently no description for this method. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  479. .. rst-class:: classref-item-separator
  480. ----
  481. .. _class_GLTFState_method_set_unique_animation_names:
  482. .. rst-class:: classref-method
  483. void **set_unique_animation_names** **(** :ref:`String[]<class_String>` unique_animation_names **)**
  484. Sets the unique animation names in the state. This is only used during the import process.
  485. .. rst-class:: classref-item-separator
  486. ----
  487. .. _class_GLTFState_method_set_unique_names:
  488. .. rst-class:: classref-method
  489. void **set_unique_names** **(** :ref:`String[]<class_String>` unique_names **)**
  490. Sets the unique node names in the state. This is used in both the import process and export process.
  491. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  492. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  493. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  494. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  495. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  496. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`