kcoley / gltf2usd

command-line utility for converting glTF 2.0 models to USD
MIT License
263 stars 39 forks source link

GLTF file causes memory leaks when loading geometry #137

Closed jclarkk closed 5 years ago

jclarkk commented 5 years ago

bad_gltf.zip For some reason the attached GLTF causes a memory leak when attempting to read the buffer.

The problem seems to be when iterating over all attributes in the primitive_entry in the file Mesh.py

kcoley commented 5 years ago

@jclarkk thanks for flagging, I just made an update to cache the accessor data on loading glTF files, to help speed up the loading process. However, I noticed that this particular glTF has 79 mesh primitives under a mesh, so is a bit heavy. The export time takes a while and the resulting usd file is large since the referenced attribute data in glTF is duplicated when exporting to usd. If you use -v, you can now get progress on which mesh primitive is being exported under a mesh for debugging purposes.

jclarkk commented 5 years ago

@kcoley I can confirm issue has been fixed, thanks!