Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encoding does not return resulting faces and points count #18

Open
cansik opened this issue May 14, 2021 · 2 comments · May be fixed by #17
Open

Encoding does not return resulting faces and points count #18

cansik opened this issue May 14, 2021 · 2 comments · May be fixed by #17
Labels
enhancement New feature or request

Comments

@cansik
Copy link

cansik commented May 14, 2021

I think it would make sense to be able to get the resulting faces and points count from the encode_mesh_to_buffer method.

Currently I am writing a tool to create gltf files from mesh sequences and there I am adding mesh compression with this library. To correctly set the faces and vertices count, I need to know them after the compression. What I do as a workaround is just decode it after encoding, but this is a bit a waste of time and resources:

encoded_blob = bytearray(DracoPy.encode_mesh_to_buffer(encoded_points, encoded_triangles))

# workaorund to get point & faces size back
decoded = DracoPy.decode_buffer_to_mesh(encoded_blob)
triangles_size = len(decoded.faces)
pts_size = int(len(decoded.points) / 3)

Would it be possible to somehow return them?

@cansik
Copy link
Author

cansik commented May 16, 2021

It should be simple, if we could be able to call this method directly from python.

EncodedObject encode_mesh(const std::vector<float> &points, const std::vector<unsigned int> &faces,
      int quantization_bits, int compression_level, float quantization_range, const float *quantization_origin, bool create_metadata)

@farunurisonmez farunurisonmez linked a pull request May 16, 2021 that will close this issue
2 tasks
@farunurisonmez
Copy link

#17 You Can Check Here

@william-silversmith william-silversmith added the enhancement New feature or request label Oct 22, 2021
@william-silversmith william-silversmith linked a pull request Oct 22, 2021 that will close this issue
2 tasks
@william-silversmith william-silversmith changed the title Encoding does not return resulting faces and points count Decoding does not return resulting faces and points count Oct 22, 2021
@william-silversmith william-silversmith changed the title Decoding does not return resulting faces and points count Encoding does not return resulting faces and points count Oct 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants