react-three-csg
react-three-csg copied to clipboard
TypeError: Cannot read properties of undefined (reading 'array')
Hello, I'm using the example https://codesandbox.io/s/mlgzsc, and I just changed the loaded glb file from the rabbit to my own model. However, the program is reporting an error as shown in the title. What should I do?
Here is the vertex and normal output of my model
Normals:
BufferAttribute {isBufferAttribute: true, name: "", array: Float32Array, itemSize: 3, count: 233893…}
isBufferAttribute: true
name: ""
array: Float32Array
itemSize: 3
count: 233893
normalized: false
usage: 35044
updateRange: Object
version: 0
Vertices:
BufferAttribute {isBufferAttribute: true, name: "", array: Float32Array, itemSize: 3, count: 233893…}
isBufferAttribute: true
name: ""
array: Float32Array
itemSize: 3
count: 233893
normalized: false
usage: 35044
updateRange: Object
version: 0
@KIC-Crack Faced the same error last week when I loaded a model that didn't have attributes.uv
, which the underlying library is explicitly looking for.
A workaround for me was to populate attributes.uv
with an empty array after load:
geometry.setAttribute('uv', new BufferAttribute(new Float32Array([]), 1))