class_gltfstate.rst 49 KB

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