class_gltfstate.rst 49 KB

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