GLTFAccessor
Inherits: Resource < RefCounted < Object
Represents a GLTF accessor.
Description
GLTFAccessor is a data structure representing GLTF a 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.
Tutorials
Properties
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
Enumerations
enum GLTFAccessorType: 🔗
GLTFAccessorType TYPE_SCALAR = 0
Accessor type “SCALAR”. For the glTF object model, this can be used to map to a single float, int, or bool value, or a float array.
GLTFAccessorType TYPE_VEC2 = 1
Accessor type “VEC2”. For the glTF object model, this maps to “float2”, represented in the glTF JSON as an array of two floats.
GLTFAccessorType TYPE_VEC3 = 2
Accessor type “VEC3”. For the glTF object model, this maps to “float3”, represented in the glTF JSON as an array of three floats.
GLTFAccessorType TYPE_VEC4 = 3
Accessor type “VEC4”. For the glTF object model, this maps to “float4”, represented in the glTF JSON as an array of four floats.
GLTFAccessorType TYPE_MAT2 = 4
Accessor type “MAT2”. For the glTF object model, this maps to “float2x2”, represented in the glTF JSON as an array of four floats.
GLTFAccessorType TYPE_MAT3 = 5
Accessor type “MAT3”. For the glTF object model, this maps to “float3x3”, represented in the glTF JSON as an array of nine floats.
GLTFAccessorType TYPE_MAT4 = 6
Accessor type “MAT4”. For the glTF object model, this maps to “float4x4”, represented in the glTF JSON as an array of sixteen floats.
Property Descriptions
GLTFAccessorType accessor_type = 0
🔗
void set_accessor_type(value: GLTFAccessorType)
GLTFAccessorType get_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”.
The index of the buffer view this accessor is referencing. If -1
, this accessor is not referencing any buffer view.
The offset relative to the start of the buffer view in bytes.
The GLTF component type as an enum. Possible values are 5120 for “BYTE”, 5121 for “UNSIGNED_BYTE”, 5122 for “SHORT”, 5123 for “UNSIGNED_SHORT”, 5125 for “UNSIGNED_INT”, and 5126 for “FLOAT”. A value of 5125 or “UNSIGNED_INT” must not be used for any accessor that is not referenced by mesh.primitive.indices.
The number of elements referenced by this accessor.
PackedFloat64Array max = PackedFloat64Array()
🔗
void set_max(value: PackedFloat64Array)
PackedFloat64Array get_max()
Maximum value of each component in this accessor.
PackedFloat64Array min = PackedFloat64Array()
🔗
void set_min(value: PackedFloat64Array)
PackedFloat64Array get_min()
Minimum value of each component in this accessor.
Specifies whether integer data values are normalized before usage.
Number of deviating accessor values stored in the sparse array.
int sparse_indices_buffer_view = 0
🔗
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.
int sparse_indices_byte_offset = 0
🔗
The offset relative to the start of the buffer view in bytes.
int sparse_indices_component_type = 0
🔗
The indices component data type as an enum. Possible values are 5121 for “UNSIGNED_BYTE”, 5123 for “UNSIGNED_SHORT”, and 5125 for “UNSIGNED_INT”.
int sparse_values_buffer_view = 0
🔗
The index of the bufferView with sparse values. The referenced buffer view MUST NOT have its target or byteStride properties defined.
int sparse_values_byte_offset = 0
🔗
The offset relative to the start of the bufferView in bytes.
Deprecated: Use accessor_type instead.
The GLTF accessor type as an enum. Use accessor_type instead.
User-contributed notes
Please read the User-contributed notes policy before submitting a comment.