class_gltfbufferview.rst 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  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/GLTFBufferView.xml.
  6. .. _class_GLTFBufferView:
  7. GLTFBufferView
  8. ==============
  9. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. Represents a glTF buffer view.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. GLTFBufferView is a data structure representing a glTF ``bufferView`` that would be found in the ``"bufferViews"`` array. A buffer is a blob of binary data. A buffer view is a slice of a buffer that can be used to identify and extract data from the buffer.
  15. Most custom uses of buffers only need to use the :ref:`buffer<class_GLTFBufferView_property_buffer>`, :ref:`byte_length<class_GLTFBufferView_property_byte_length>`, and :ref:`byte_offset<class_GLTFBufferView_property_byte_offset>`. The :ref:`byte_stride<class_GLTFBufferView_property_byte_stride>` and :ref:`indices<class_GLTFBufferView_property_indices>` properties are for more advanced use cases such as interleaved mesh data encoded for the GPU.
  16. .. rst-class:: classref-introduction-group
  17. Tutorials
  18. ---------
  19. - `Buffers, BufferViews, and Accessors in Khronos glTF specification <https://github.com/KhronosGroup/glTF-Tutorials/blob/master/gltfTutorial/gltfTutorial_005_BuffersBufferViewsAccessors.md>`__
  20. - :doc:`Runtime file loading and saving <../tutorials/io/runtime_file_loading_and_saving>`
  21. .. rst-class:: classref-reftable-group
  22. Properties
  23. ----------
  24. .. table::
  25. :widths: auto
  26. +-------------------------+---------------------------------------------------------------------------+-----------+
  27. | :ref:`int<class_int>` | :ref:`buffer<class_GLTFBufferView_property_buffer>` | ``-1`` |
  28. +-------------------------+---------------------------------------------------------------------------+-----------+
  29. | :ref:`int<class_int>` | :ref:`byte_length<class_GLTFBufferView_property_byte_length>` | ``0`` |
  30. +-------------------------+---------------------------------------------------------------------------+-----------+
  31. | :ref:`int<class_int>` | :ref:`byte_offset<class_GLTFBufferView_property_byte_offset>` | ``0`` |
  32. +-------------------------+---------------------------------------------------------------------------+-----------+
  33. | :ref:`int<class_int>` | :ref:`byte_stride<class_GLTFBufferView_property_byte_stride>` | ``-1`` |
  34. +-------------------------+---------------------------------------------------------------------------+-----------+
  35. | :ref:`bool<class_bool>` | :ref:`indices<class_GLTFBufferView_property_indices>` | ``false`` |
  36. +-------------------------+---------------------------------------------------------------------------+-----------+
  37. | :ref:`bool<class_bool>` | :ref:`vertex_attributes<class_GLTFBufferView_property_vertex_attributes>` | ``false`` |
  38. +-------------------------+---------------------------------------------------------------------------+-----------+
  39. .. rst-class:: classref-reftable-group
  40. Methods
  41. -------
  42. .. table::
  43. :widths: auto
  44. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+
  45. | :ref:`GLTFBufferView<class_GLTFBufferView>` | :ref:`from_dictionary<class_GLTFBufferView_method_from_dictionary>`\ (\ dictionary\: :ref:`Dictionary<class_Dictionary>`\ ) |static| |
  46. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+
  47. | :ref:`PackedByteArray<class_PackedByteArray>` | :ref:`load_buffer_view_data<class_GLTFBufferView_method_load_buffer_view_data>`\ (\ state\: :ref:`GLTFState<class_GLTFState>`\ ) |const| |
  48. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+
  49. | :ref:`Dictionary<class_Dictionary>` | :ref:`to_dictionary<class_GLTFBufferView_method_to_dictionary>`\ (\ ) |const| |
  50. +-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+
  51. .. rst-class:: classref-section-separator
  52. ----
  53. .. rst-class:: classref-descriptions-group
  54. Property Descriptions
  55. ---------------------
  56. .. _class_GLTFBufferView_property_buffer:
  57. .. rst-class:: classref-property
  58. :ref:`int<class_int>` **buffer** = ``-1`` :ref:`🔗<class_GLTFBufferView_property_buffer>`
  59. .. rst-class:: classref-property-setget
  60. - |void| **set_buffer**\ (\ value\: :ref:`int<class_int>`\ )
  61. - :ref:`int<class_int>` **get_buffer**\ (\ )
  62. The index of the buffer this buffer view is referencing. If ``-1``, this buffer view is not referencing any buffer.
  63. .. rst-class:: classref-item-separator
  64. ----
  65. .. _class_GLTFBufferView_property_byte_length:
  66. .. rst-class:: classref-property
  67. :ref:`int<class_int>` **byte_length** = ``0`` :ref:`🔗<class_GLTFBufferView_property_byte_length>`
  68. .. rst-class:: classref-property-setget
  69. - |void| **set_byte_length**\ (\ value\: :ref:`int<class_int>`\ )
  70. - :ref:`int<class_int>` **get_byte_length**\ (\ )
  71. The length, in bytes, of this buffer view. If ``0``, this buffer view is empty.
  72. .. rst-class:: classref-item-separator
  73. ----
  74. .. _class_GLTFBufferView_property_byte_offset:
  75. .. rst-class:: classref-property
  76. :ref:`int<class_int>` **byte_offset** = ``0`` :ref:`🔗<class_GLTFBufferView_property_byte_offset>`
  77. .. rst-class:: classref-property-setget
  78. - |void| **set_byte_offset**\ (\ value\: :ref:`int<class_int>`\ )
  79. - :ref:`int<class_int>` **get_byte_offset**\ (\ )
  80. The offset, in bytes, from the start of the buffer to the start of this buffer view.
  81. .. rst-class:: classref-item-separator
  82. ----
  83. .. _class_GLTFBufferView_property_byte_stride:
  84. .. rst-class:: classref-property
  85. :ref:`int<class_int>` **byte_stride** = ``-1`` :ref:`🔗<class_GLTFBufferView_property_byte_stride>`
  86. .. rst-class:: classref-property-setget
  87. - |void| **set_byte_stride**\ (\ value\: :ref:`int<class_int>`\ )
  88. - :ref:`int<class_int>` **get_byte_stride**\ (\ )
  89. The stride, in bytes, between interleaved data. If ``-1``, this buffer view is not interleaved.
  90. .. rst-class:: classref-item-separator
  91. ----
  92. .. _class_GLTFBufferView_property_indices:
  93. .. rst-class:: classref-property
  94. :ref:`bool<class_bool>` **indices** = ``false`` :ref:`🔗<class_GLTFBufferView_property_indices>`
  95. .. rst-class:: classref-property-setget
  96. - |void| **set_indices**\ (\ value\: :ref:`bool<class_bool>`\ )
  97. - :ref:`bool<class_bool>` **get_indices**\ (\ )
  98. ``true`` if the GLTFBufferView's OpenGL GPU buffer type is an ``ELEMENT_ARRAY_BUFFER`` used for vertex indices (integer constant ``34963``). ``false`` if the buffer type is any other value. See `Buffers, BufferViews, and Accessors <https://github.com/KhronosGroup/glTF-Tutorials/blob/master/gltfTutorial/gltfTutorial_005_BuffersBufferViewsAccessors.md>`__ for possible values. This property is set on import and used on export.
  99. .. rst-class:: classref-item-separator
  100. ----
  101. .. _class_GLTFBufferView_property_vertex_attributes:
  102. .. rst-class:: classref-property
  103. :ref:`bool<class_bool>` **vertex_attributes** = ``false`` :ref:`🔗<class_GLTFBufferView_property_vertex_attributes>`
  104. .. rst-class:: classref-property-setget
  105. - |void| **set_vertex_attributes**\ (\ value\: :ref:`bool<class_bool>`\ )
  106. - :ref:`bool<class_bool>` **get_vertex_attributes**\ (\ )
  107. ``true`` if the GLTFBufferView's OpenGL GPU buffer type is an ``ARRAY_BUFFER`` used for vertex attributes (integer constant ``34962``). ``false`` if the buffer type is any other value. See `Buffers, BufferViews, and Accessors <https://github.com/KhronosGroup/glTF-Tutorials/blob/master/gltfTutorial/gltfTutorial_005_BuffersBufferViewsAccessors.md>`__ for possible values. This property is set on import and used on export.
  108. .. rst-class:: classref-section-separator
  109. ----
  110. .. rst-class:: classref-descriptions-group
  111. Method Descriptions
  112. -------------------
  113. .. _class_GLTFBufferView_method_from_dictionary:
  114. .. rst-class:: classref-method
  115. :ref:`GLTFBufferView<class_GLTFBufferView>` **from_dictionary**\ (\ dictionary\: :ref:`Dictionary<class_Dictionary>`\ ) |static| :ref:`🔗<class_GLTFBufferView_method_from_dictionary>`
  116. Creates a new GLTFBufferView instance by parsing the given :ref:`Dictionary<class_Dictionary>`.
  117. .. rst-class:: classref-item-separator
  118. ----
  119. .. _class_GLTFBufferView_method_load_buffer_view_data:
  120. .. rst-class:: classref-method
  121. :ref:`PackedByteArray<class_PackedByteArray>` **load_buffer_view_data**\ (\ state\: :ref:`GLTFState<class_GLTFState>`\ ) |const| :ref:`🔗<class_GLTFBufferView_method_load_buffer_view_data>`
  122. Loads the buffer view data from the buffer referenced by this buffer view in the given :ref:`GLTFState<class_GLTFState>`. Interleaved data with a byte stride is not yet supported by this method. The data is returned as a :ref:`PackedByteArray<class_PackedByteArray>`.
  123. .. rst-class:: classref-item-separator
  124. ----
  125. .. _class_GLTFBufferView_method_to_dictionary:
  126. .. rst-class:: classref-method
  127. :ref:`Dictionary<class_Dictionary>` **to_dictionary**\ (\ ) |const| :ref:`🔗<class_GLTFBufferView_method_to_dictionary>`
  128. Serializes this GLTFBufferView instance into a :ref:`Dictionary<class_Dictionary>`.
  129. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  130. .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
  131. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  132. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  133. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  134. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  135. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  136. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  137. .. |void| replace:: :abbr:`void (No return value.)`