donmccurdy / glTF-Transform

glTF 2.0 SDK for JavaScript and TypeScript, on Web and Node.js.
https://gltf-transform.dev
MIT License
1.3k stars 145 forks source link

fix(functions): Avoid failure when Draco generates new accessors #1385

Closed donmccurdy closed 2 months ago

donmccurdy commented 2 months ago

Draco compression will, in rare cases, require generating new accessors. That's not ideal — I'd much prefer that the I/O process not modify the input Document at all — but it is a current limitation in the encoding process.

Previously some other code in the general I/O pipeline assumed that the accessor list was known in advance, and caused failures when the accessor count changed later. This PR removes the assumption.

https://github.com/donmccurdy/glTF-Transform/blob/de19547de2659c605bba28531b26b7aa87d832bc/packages/extensions/src/khr-draco-mesh-compression/draco-mesh-compression.ts#L397-L413

Related:

Remaining: