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

Support for base64 encoded buffers #59

Open
tulvanchristian opened this issue Sep 22, 2020 · 5 comments
Open

Support for base64 encoded buffers #59

tulvanchristian opened this issue Sep 22, 2020 · 5 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@tulvanchristian
Copy link

Hello,

Currently, the buffers are referenced by URI (path to bin file)
I propose adding a function to set the URI as a base64 encoded string. The encoding itself could be done outside of the library.

As a work-around a base64 buffer can be set by using the URI variable with the appropriate length.
Update on GLTFSDK/Source/BufferBuilder.cpp to add setCurrentBufferURI function
280: + bool BufferBuilder::setCurrentBufferURI ( const std::string &data )
281: + {
282: + assert ( m_buffers.size() > 0 );
283: + size_t index = m_buffers.size() - 1;
284: + m_buffers [ index ].uri = data;
285: + m_buffers [ index ].length = data.length();
286: + return true;
287: + }
288: +

Please let me know if I should create a pull request.

Thank you !

@bghgary
Copy link
Contributor

bghgary commented Sep 22, 2020

Please let me know if I should create a pull request.

Yes, please do. It will be easier to comment then pasting code in an issue :-)

@tulvanchristian
Copy link
Author

Thank you for the reply.
I updated the code but when i try to create a new branch and create a new pull request, i get permission denied.
Are the permissions on my account enough for these actions ? Or is there a different procedure ?
Best regards,
Christian

@bghgary
Copy link
Contributor

bghgary commented Sep 30, 2020

Typically you want to create a fork and then create a PR from the fork. Try this.

@tulvanchristian
Copy link
Author

Thanks a lot for the help.
I just created a fork and pushed the code here:
https://github.com/tulvanchristian/glTF-SDK

The commit includes fixes for:

Please let me know if this is ok and if you need more information, do not hesitate to contact me.

Best regards,
Christian

@bghgary
Copy link
Contributor

bghgary commented Oct 5, 2020

Please create a pull request from the branch in your fork. Thanks!

@bghgary bghgary added enhancement New feature or request triaged help wanted Extra attention is needed labels Dec 7, 2023
@thomlucc thomlucc removed the triaged label Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants