Table of Contents

Class GLTFAccessor

Represents a glTF accessor.

Inheritance
GLTFAccessor

Remarks

GLTFAccessor is a data structure representing a glTF accessor that would be found in the "accessors" array. A buffer is a blob of binary data. A buffer view is a slice of a buffer. An accessor is a typed interpretation of the data in a buffer view.

Most custom data stored in glTF does not need accessors, only buffer views (see GLTFBufferView). Accessors are for more advanced use cases such as interleaved mesh data encoded for the GPU.

See Also

Properties

accessor_type

The glTF accessor type as an enum. Possible values are 0 for "SCALAR", 1 for "VEC2", 2 for "VEC3", 3 for "VEC4", 4 for "MAT2", 5 for "MAT3", and 6 for "MAT4".

var accessor_type : int = 0

Property Value

int

Remarks

  • void set_accessor_type(int value)
  • int get_accessor_type

buffer_view

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

var buffer_view : int = -1

Property Value

int

Remarks

  • void set_buffer_view(int value)
  • int get_buffer_view

byte_offset

The offset relative to the start of the buffer view in bytes.

var byte_offset : int = 0

Property Value

int

Remarks

  • void set_byte_offset(int value)
  • int get_byte_offset

component_type

The glTF component type as an enum. See GLTFComponentType for possible values. Within the core glTF specification, a value of 5125 or "UNSIGNED_INT" must not be used for any accessor that is not referenced by mesh.primitive.indices.

var component_type : int = 0

Property Value

int

Remarks

  • void set_component_type(int value)
  • int get_component_type

count

The number of elements referenced by this accessor.

var count : int = 0

Property Value

int

Remarks

  • void set_count(int value)
  • int get_count

max

Maximum value of each component in this accessor.

var max : PackedFloat64Array = PackedFloat64Array()

Property Value

PackedFloat64Array

Remarks

min

Minimum value of each component in this accessor.

var min : PackedFloat64Array = PackedFloat64Array()

Property Value

PackedFloat64Array

Remarks

normalized

Specifies whether integer data values are normalized before usage.

var normalized : bool = false

Property Value

bool

Remarks

  • void set_normalized(bool value)
  • bool get_normalized

sparse_count

Number of deviating accessor values stored in the sparse array.

var sparse_count : int = 0

Property Value

int

Remarks

  • void set_sparse_count(int value)
  • int get_sparse_count

sparse_indices_buffer_view

The index of the buffer view with sparse indices. The referenced buffer view MUST NOT have its target or byteStride properties defined. The buffer view and the optional byteOffset MUST be aligned to the componentType byte length.

var sparse_indices_buffer_view : int = 0

Property Value

int

Remarks

  • void set_sparse_indices_buffer_view(int value)
  • int get_sparse_indices_buffer_view

sparse_indices_byte_offset

The offset relative to the start of the buffer view in bytes.

var sparse_indices_byte_offset : int = 0

Property Value

int

Remarks

  • void set_sparse_indices_byte_offset(int value)
  • int get_sparse_indices_byte_offset

sparse_indices_component_type

The indices component data type as an enum. Possible values are 5121 for "UNSIGNED_BYTE", 5123 for "UNSIGNED_SHORT", and 5125 for "UNSIGNED_INT".

var sparse_indices_component_type : int = 0

Property Value

int

Remarks

  • void set_sparse_indices_component_type(int value)
  • int get_sparse_indices_component_type

sparse_values_buffer_view

The index of the bufferView with sparse values. The referenced buffer view MUST NOT have its target or byteStride properties defined.

var sparse_values_buffer_view : int = 0

Property Value

int

Remarks

  • void set_sparse_values_buffer_view(int value)
  • int get_sparse_values_buffer_view

sparse_values_byte_offset

The offset relative to the start of the bufferView in bytes.

var sparse_values_byte_offset : int = 0

Property Value

int

Remarks

  • void set_sparse_values_byte_offset(int value)
  • int get_sparse_values_byte_offset

type

The glTF accessor type as an enum. Use accessor_type instead.

var type : int

Property Value

int

Remarks

  • void set_type(int value)
  • int get_type