qmuntal / gltf

Go library for encoding glTF 2.0 files
https://www.khronos.org/gltf/
BSD 2-Clause "Simplified" License
241 stars 32 forks source link

Add name field to BufferView #68

Closed zvdm closed 1 year ago

zvdm commented 1 year ago

Hi,

In my work we have to use BufferView name field. According to the official documentation BufferView can contain not required field name. I found that the appropriate strut doesn't contain such field. Could we please add name field to BufferView struct like in a sample below?

// BufferView is a view into a buffer generally representing a subset of the buffer.
type BufferView struct {
    Extensions Extensions  `json:"extensions,omitempty"`
    Extras     interface{} `json:"extras,omitempty"`
    Buffer     uint32      `json:"buffer"`
    ByteOffset uint32      `json:"byteOffset,omitempty"`
    ByteLength uint32      `json:"byteLength" validate:"required"`
    ByteStride uint32      `json:"byteStride,omitempty" validate:"omitempty,gte=4,lte=252"`
    Target     Target      `json:"target,omitempty" validate:"omitempty,oneof=34962 34963"`
    Name       string      `json:"name,omitempty"`
}

For that, I prepared the appropriate PR.

Thank you, in advance!

qmuntal commented 1 year ago

Thanks for reporting this and for the PR. I'll merge it and cut a new version.