2
0

class_gltfnode.rst 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  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/3.6/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.6/modules/gltf/doc_classes/GLTFNode.xml.
  6. .. _class_GLTFNode:
  7. GLTFNode
  8. ========
  9. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  10. GLTF node class.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. Represents a GLTF node. GLTF nodes may have names, transforms, children (other GLTF nodes), and more specialized properties (represented by their own classes).
  15. \ **Note:** This class is only compiled in editor builds. Run-time glTF loading and saving is *not* available in exported projects. References to **GLTFNode** within a script will cause an error in an exported project.
  16. .. rst-class:: classref-introduction-group
  17. Tutorials
  18. ---------
  19. - `GLTF scene and node spec <https://github.com/KhronosGroup/glTF-Tutorials/blob/master/gltfTutorial/gltfTutorial_004_ScenesNodes.md">`__
  20. .. rst-class:: classref-reftable-group
  21. Properties
  22. ----------
  23. .. table::
  24. :widths: auto
  25. +-----------------------------------------+---------------------------------------------------------+-----------------------------------------------------+
  26. | :ref:`int<class_int>` | :ref:`camera<class_GLTFNode_property_camera>` | ``-1`` |
  27. +-----------------------------------------+---------------------------------------------------------+-----------------------------------------------------+
  28. | :ref:`PoolIntArray<class_PoolIntArray>` | :ref:`children<class_GLTFNode_property_children>` | ``PoolIntArray( )`` |
  29. +-----------------------------------------+---------------------------------------------------------+-----------------------------------------------------+
  30. | :ref:`int<class_int>` | :ref:`height<class_GLTFNode_property_height>` | ``-1`` |
  31. +-----------------------------------------+---------------------------------------------------------+-----------------------------------------------------+
  32. | :ref:`bool<class_bool>` | :ref:`joint<class_GLTFNode_property_joint>` | ``false`` |
  33. +-----------------------------------------+---------------------------------------------------------+-----------------------------------------------------+
  34. | :ref:`int<class_int>` | :ref:`light<class_GLTFNode_property_light>` | ``-1`` |
  35. +-----------------------------------------+---------------------------------------------------------+-----------------------------------------------------+
  36. | :ref:`int<class_int>` | :ref:`mesh<class_GLTFNode_property_mesh>` | ``-1`` |
  37. +-----------------------------------------+---------------------------------------------------------+-----------------------------------------------------+
  38. | :ref:`int<class_int>` | :ref:`parent<class_GLTFNode_property_parent>` | ``-1`` |
  39. +-----------------------------------------+---------------------------------------------------------+-----------------------------------------------------+
  40. | :ref:`Quat<class_Quat>` | :ref:`rotation<class_GLTFNode_property_rotation>` | ``Quat( 0, 0, 0, 1 )`` |
  41. +-----------------------------------------+---------------------------------------------------------+-----------------------------------------------------+
  42. | :ref:`Vector3<class_Vector3>` | :ref:`scale<class_GLTFNode_property_scale>` | ``Vector3( 1, 1, 1 )`` |
  43. +-----------------------------------------+---------------------------------------------------------+-----------------------------------------------------+
  44. | :ref:`int<class_int>` | :ref:`skeleton<class_GLTFNode_property_skeleton>` | ``-1`` |
  45. +-----------------------------------------+---------------------------------------------------------+-----------------------------------------------------+
  46. | :ref:`int<class_int>` | :ref:`skin<class_GLTFNode_property_skin>` | ``-1`` |
  47. +-----------------------------------------+---------------------------------------------------------+-----------------------------------------------------+
  48. | :ref:`Vector3<class_Vector3>` | :ref:`translation<class_GLTFNode_property_translation>` | ``Vector3( 0, 0, 0 )`` |
  49. +-----------------------------------------+---------------------------------------------------------+-----------------------------------------------------+
  50. | :ref:`Transform<class_Transform>` | :ref:`xform<class_GLTFNode_property_xform>` | ``Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )`` |
  51. +-----------------------------------------+---------------------------------------------------------+-----------------------------------------------------+
  52. .. rst-class:: classref-reftable-group
  53. Methods
  54. -------
  55. .. table::
  56. :widths: auto
  57. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | :ref:`Variant<class_Variant>` | :ref:`get_additional_data<class_GLTFNode_method_get_additional_data>` **(** :ref:`String<class_String>` extension_name **)** |
  59. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | void | :ref:`set_additional_data<class_GLTFNode_method_set_additional_data>` **(** :ref:`String<class_String>` extension_name, :ref:`Variant<class_Variant>` additional_data **)** |
  61. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. .. rst-class:: classref-section-separator
  63. ----
  64. .. rst-class:: classref-descriptions-group
  65. Property Descriptions
  66. ---------------------
  67. .. _class_GLTFNode_property_camera:
  68. .. rst-class:: classref-property
  69. :ref:`int<class_int>` **camera** = ``-1``
  70. .. rst-class:: classref-property-setget
  71. - void **set_camera** **(** :ref:`int<class_int>` value **)**
  72. - :ref:`int<class_int>` **get_camera** **(** **)**
  73. If this GLTF node is a camera, the index of the :ref:`GLTFCamera<class_GLTFCamera>` in the :ref:`GLTFState<class_GLTFState>` that describes the camera's properties. If -1, this node is not a camera.
  74. .. rst-class:: classref-item-separator
  75. ----
  76. .. _class_GLTFNode_property_children:
  77. .. rst-class:: classref-property
  78. :ref:`PoolIntArray<class_PoolIntArray>` **children** = ``PoolIntArray( )``
  79. .. rst-class:: classref-property-setget
  80. - void **set_children** **(** :ref:`PoolIntArray<class_PoolIntArray>` value **)**
  81. - :ref:`PoolIntArray<class_PoolIntArray>` **get_children** **(** **)**
  82. The indices of the children nodes in the :ref:`GLTFState<class_GLTFState>`. If this GLTF node has no children, this will be an empty array.
  83. .. rst-class:: classref-item-separator
  84. ----
  85. .. _class_GLTFNode_property_height:
  86. .. rst-class:: classref-property
  87. :ref:`int<class_int>` **height** = ``-1``
  88. .. rst-class:: classref-property-setget
  89. - void **set_height** **(** :ref:`int<class_int>` value **)**
  90. - :ref:`int<class_int>` **get_height** **(** **)**
  91. How deep into the node hierarchy this node is. A root node will have a height of 0, its children will have a height of 1, and so on. If -1, the height has not been calculated.
  92. .. rst-class:: classref-item-separator
  93. ----
  94. .. _class_GLTFNode_property_joint:
  95. .. rst-class:: classref-property
  96. :ref:`bool<class_bool>` **joint** = ``false``
  97. .. rst-class:: classref-property-setget
  98. - void **set_joint** **(** :ref:`bool<class_bool>` value **)**
  99. - :ref:`bool<class_bool>` **get_joint** **(** **)**
  100. This property is unused and does nothing.
  101. .. rst-class:: classref-item-separator
  102. ----
  103. .. _class_GLTFNode_property_light:
  104. .. rst-class:: classref-property
  105. :ref:`int<class_int>` **light** = ``-1``
  106. .. rst-class:: classref-property-setget
  107. - void **set_light** **(** :ref:`int<class_int>` value **)**
  108. - :ref:`int<class_int>` **get_light** **(** **)**
  109. If this GLTF node is a light, the index of the :ref:`GLTFLight<class_GLTFLight>` in the :ref:`GLTFState<class_GLTFState>` that describes the light's properties. If -1, this node is not a light.
  110. .. rst-class:: classref-item-separator
  111. ----
  112. .. _class_GLTFNode_property_mesh:
  113. .. rst-class:: classref-property
  114. :ref:`int<class_int>` **mesh** = ``-1``
  115. .. rst-class:: classref-property-setget
  116. - void **set_mesh** **(** :ref:`int<class_int>` value **)**
  117. - :ref:`int<class_int>` **get_mesh** **(** **)**
  118. If this GLTF node is a mesh, the index of the :ref:`GLTFMesh<class_GLTFMesh>` in the :ref:`GLTFState<class_GLTFState>` that describes the mesh's properties. If -1, this node is not a mesh.
  119. .. rst-class:: classref-item-separator
  120. ----
  121. .. _class_GLTFNode_property_parent:
  122. .. rst-class:: classref-property
  123. :ref:`int<class_int>` **parent** = ``-1``
  124. .. rst-class:: classref-property-setget
  125. - void **set_parent** **(** :ref:`int<class_int>` value **)**
  126. - :ref:`int<class_int>` **get_parent** **(** **)**
  127. The index of the parent node in the :ref:`GLTFState<class_GLTFState>`. If -1, this node is a root node.
  128. .. rst-class:: classref-item-separator
  129. ----
  130. .. _class_GLTFNode_property_rotation:
  131. .. rst-class:: classref-property
  132. :ref:`Quat<class_Quat>` **rotation** = ``Quat( 0, 0, 0, 1 )``
  133. .. rst-class:: classref-property-setget
  134. - void **set_rotation** **(** :ref:`Quat<class_Quat>` value **)**
  135. - :ref:`Quat<class_Quat>` **get_rotation** **(** **)**
  136. The rotation of the GLTF node relative to its parent.
  137. .. rst-class:: classref-item-separator
  138. ----
  139. .. _class_GLTFNode_property_scale:
  140. .. rst-class:: classref-property
  141. :ref:`Vector3<class_Vector3>` **scale** = ``Vector3( 1, 1, 1 )``
  142. .. rst-class:: classref-property-setget
  143. - void **set_scale** **(** :ref:`Vector3<class_Vector3>` value **)**
  144. - :ref:`Vector3<class_Vector3>` **get_scale** **(** **)**
  145. The scale of the GLTF node relative to its parent.
  146. .. rst-class:: classref-item-separator
  147. ----
  148. .. _class_GLTFNode_property_skeleton:
  149. .. rst-class:: classref-property
  150. :ref:`int<class_int>` **skeleton** = ``-1``
  151. .. rst-class:: classref-property-setget
  152. - void **set_skeleton** **(** :ref:`int<class_int>` value **)**
  153. - :ref:`int<class_int>` **get_skeleton** **(** **)**
  154. If this GLTF node has a skeleton, the index of the :ref:`GLTFSkeleton<class_GLTFSkeleton>` in the :ref:`GLTFState<class_GLTFState>` that describes the skeleton's properties. If -1, this node does not have a skeleton.
  155. .. rst-class:: classref-item-separator
  156. ----
  157. .. _class_GLTFNode_property_skin:
  158. .. rst-class:: classref-property
  159. :ref:`int<class_int>` **skin** = ``-1``
  160. .. rst-class:: classref-property-setget
  161. - void **set_skin** **(** :ref:`int<class_int>` value **)**
  162. - :ref:`int<class_int>` **get_skin** **(** **)**
  163. If this GLTF node has a skin, the index of the :ref:`GLTFSkin<class_GLTFSkin>` in the :ref:`GLTFState<class_GLTFState>` that describes the skin's properties. If -1, this node does not have a skin.
  164. .. rst-class:: classref-item-separator
  165. ----
  166. .. _class_GLTFNode_property_translation:
  167. .. rst-class:: classref-property
  168. :ref:`Vector3<class_Vector3>` **translation** = ``Vector3( 0, 0, 0 )``
  169. .. rst-class:: classref-property-setget
  170. - void **set_translation** **(** :ref:`Vector3<class_Vector3>` value **)**
  171. - :ref:`Vector3<class_Vector3>` **get_translation** **(** **)**
  172. The position of the GLTF node relative to its parent.
  173. .. rst-class:: classref-item-separator
  174. ----
  175. .. _class_GLTFNode_property_xform:
  176. .. rst-class:: classref-property
  177. :ref:`Transform<class_Transform>` **xform** = ``Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )``
  178. .. rst-class:: classref-property-setget
  179. - void **set_xform** **(** :ref:`Transform<class_Transform>` value **)**
  180. - :ref:`Transform<class_Transform>` **get_xform** **(** **)**
  181. The transform of the GLTF node relative to its parent. This property is usually unused since the position, rotation, and scale properties are preferred.
  182. .. rst-class:: classref-section-separator
  183. ----
  184. .. rst-class:: classref-descriptions-group
  185. Method Descriptions
  186. -------------------
  187. .. _class_GLTFNode_method_get_additional_data:
  188. .. rst-class:: classref-method
  189. :ref:`Variant<class_Variant>` **get_additional_data** **(** :ref:`String<class_String>` extension_name **)**
  190. Gets additional arbitrary data in this **GLTFNode** instance. This can be used to keep per-node state data in :ref:`GLTFDocumentExtension<class_GLTFDocumentExtension>` classes, which is important because they are stateless.
  191. 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.
  192. .. rst-class:: classref-item-separator
  193. ----
  194. .. _class_GLTFNode_method_set_additional_data:
  195. .. rst-class:: classref-method
  196. void **set_additional_data** **(** :ref:`String<class_String>` extension_name, :ref:`Variant<class_Variant>` additional_data **)**
  197. Sets additional arbitrary data in this **GLTFNode** instance. This can be used to keep per-node state data in :ref:`GLTFDocumentExtension<class_GLTFDocumentExtension>` classes, which is important because they are stateless.
  198. 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.
  199. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  200. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  201. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  202. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`