question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Draco encoder, "Error compressing attribute"

See original GitHub issue

I ran into this peculiar error:

Error: Error compressing "COLOR_0" attribute.

It comes from here: https://github.com/donmccurdy/glTF-Transform/blob/1ef6be94787c4c6dcb21d011d219de73b0ff0e8a/packages/extensions/src/khr-draco-mesh-compression/encoder.ts#L80

I did a bit of digging and can verify a few things:

  • The attribute seems to be created on the Mesh object created by the encoder module via const mesh = new encoderModule.Mesh();, as the value of mesh.num_attributes() is 7, and this happens to be the 7th, and last one.
  • attribute.getComponentType() is ‌5126 (that’s the same value as Accessor.ComponentType.FLOAT)
  • attribute.getCount() is 450
  • attribute.getElementSize() is 4
  • attribute.getArray() is a Float32Array of size 1800, this checks out as 450 * 4

Since the result value is just -1, I’m having a bit of a difficulty understanding the reason for this failure.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
donmccurdycommented, Feb 5, 2021

Sorry, I haven’t been able to find a way to reproduce this issue. If this error comes up again with a model you are able to share, please let me know!

1reaction
donmccurdycommented, Jan 22, 2021

Which steps lead to a successfully converted and compressed model?

Another idea to try would be higher values (16?) of the --quantizeColor option.

I’ve tried running a batch conversion over ~50 samples I had on hand, and couldn’t reproduce this error for any of them, so I think I may need to leave this open until someone can share a reproducible case. It may be that I’ve implemented something incorrectly here, but glTF-Pipeline also pre-processes the data a bit more, so I wonder if that is just smoothing out some edge case that the Draco encoder doesn’t like.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The first Draco 3D object crypto-compression scheme
During the rANS encoding step of the Draco compression scheme, we propose encrypting the encoded vertex prediction errors. This encryption is per-.
Read more >
How to encode/compress gltf to draco - reactjs - Stack Overflow
I want to compress/encode gltf file using draco programatically in threejs with reactjs. I dont want to use any commandline tool, ...
Read more >
Gltf export error when I use Draco compression - Blender Artists
There is a proposed fix for this issue in https://github.com/KhronosGroup/glTF-Blender-IO/pull/1352; it hasn't been released yet though. In the ...
Read more >
[SOLVED] Error when loading glb compressed with Draco
I'm new with GLB compressed with Draco. ... Error loading model: 3dModel_draco.glb [TypeError: Cannot read property 'buffer' of undefined].
Read more >
gltf-pipeline - npm
Draco compression level [0-10], most is 10, least is 0. A value of 0 will apply sequential encoding and preserve face order. No,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found