Table of Contents

Class GLTFBufferView

Represents a glTF buffer view.

Inheritance
GLTFBufferView

Remarks

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.

Most custom uses of buffers only need to use the buffer, byte_length, and byte_offset. The byte_stride and indices properties are for more advanced use cases such as interleaved mesh data encoded for the GPU.

See Also

Properties

buffer

The index of the buffer this buffer view is referencing. If -1, this buffer view is not referencing any buffer.

var buffer : int = -1

Property Value

int

Remarks

  • void set_buffer(int value)
  • int get_buffer

byte_length

The length, in bytes, of this buffer view. If 0, this buffer view is empty.

var byte_length : int = 0

Property Value

int

Remarks

  • void set_byte_length(int value)
  • int get_byte_length

byte_offset

The offset, in bytes, from the start of the buffer to the start of this buffer view.

var byte_offset : int = 0

Property Value

int

Remarks

  • void set_byte_offset(int value)
  • int get_byte_offset

byte_stride

The stride, in bytes, between interleaved data. If -1, this buffer view is not interleaved.

var byte_stride : int = -1

Property Value

int

Remarks

  • void set_byte_stride(int value)
  • int get_byte_stride

indices

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 for possible values. This property is set on import and used on export.

var indices : bool = false

Property Value

bool

Remarks

  • void set_indices(bool value)
  • bool get_indices

vertex_attributes

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 for possible values. This property is set on import and used on export.

var vertex_attributes : bool = false

Property Value

bool

Remarks

  • void set_vertex_attributes(bool value)
  • bool get_vertex_attributes

Methods

load_buffer_view_data(GLTFState)

Qualifiers: const

Loads the buffer view data from the buffer referenced by this buffer view in the given GLTFState. Interleaved data with a byte stride is not yet supported by this method. The data is returned as a PackedByteArray.

PackedByteArray load_buffer_view_data(GLTFState state)

Parameters

state GLTFState