You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think this would need some refactoring of the gltf-loader gltf2.py:
currently, the Accessor and BufferView are intermixed in some places which prevents a easy implementation for reading buffer-data with defined byteStride.
See for example VBOInfo, or more precisely the creation of it from GLTFAccessor.info() which tries to merge data from GLTFAccessor and GLTFBufferView, and then implements its own read() method for reading & preparing the gl buffer, see implementation of GLTFMesh.load().
I think, the reason for this was, to be able to merge multiple accessors & buffer-views, to make the rendering more efficient. But the current implementation cannot i.m.o. easily changed to also support byteStride, since an efficient implementation would require information from the accessor & buffer-view.
I think it would be more clean, to implement & use an appropriate method in GLTFAccessor that supports byteStride.
Thanks for pointing out this flaw. It's definitely a bit hacky and needs improvements. It was really something I threw together over the weekend with the goal of supporting most of the files in the glTF sample repository.
currently reading
glTF
data that utilizesbyteStride
in its accessors is not supported(for example, the avatars at
Ready Player Me
usebyteStride
, see https://models.readyplayer.me/678703d63cb298e56bf50122.glb?morphTargets=ARKit&textureAtlas=1024)I think this would need some refactoring of the gltf-loader
gltf2.py
:currently, the Accessor and BufferView are intermixed in some places which prevents a easy implementation for reading buffer-data with defined
byteStride
.See for example VBOInfo, or more precisely the creation of it from GLTFAccessor.info() which tries to merge data from
GLTFAccessor
andGLTFBufferView
, and then implements its ownread()
method for reading & preparing the gl buffer, see implementation of GLTFMesh.load().I think, the reason for this was, to be able to merge multiple accessors & buffer-views, to make the rendering more efficient. But the current implementation cannot i.m.o. easily changed to also support
byteStride
, since an efficient implementation would require information from the accessor & buffer-view.I think it would be more clean, to implement & use an appropriate method in
GLTFAccessor
that supportsbyteStride
.As an example for how to read data with
byteStride
, see e.g. trimesh's implementationI did try out the
trimesh
implementation and got it to work withgltf2.py
, but as I mentioned, without some refactoring, the code is quite hacky.The text was updated successfully, but these errors were encountered: