Bschnurr/fix glb empty#4
Merged
Merged
Conversation
agrittmsft
reviewed
Aug 28, 2018
|
|
||
| namespace Microsoft | ||
| { | ||
| namespace glTF |
agrittmsft
suggested changes
Aug 28, 2018
| { | ||
| auto streamWriter = std::make_shared<const StreamReaderWriter>(); | ||
| GLBResourceWriter writer(streamWriter); | ||
| std::string uri = "glb"; |
Contributor
There was a problem hiding this comment.
This is the filename, it should be more like "foo.glb"
| std::string uri = "glb"; | ||
| writer.Flush("", uri); | ||
|
|
||
| std::vector<char> output(100); |
Contributor
There was a problem hiding this comment.
This is for writing another external file such as a png, why are you doing this here?
Member
Author
There was a problem hiding this comment.
I just needed a way to access the output stream in the cache. Now i'm using the streamWriter directly
| { | ||
| GLTFSDK_TEST_CLASS(GLBResourceWriterTests) | ||
| { | ||
| GLTFSDK_TEST_METHOD(GLBResourceWriterTests, WriteBufferView_Empty) |
Contributor
There was a problem hiding this comment.
Test needs to read the output and confirm that it's a valid GLB by parsing it again.
agrittmsft
reviewed
Aug 28, 2018
| std::string uri = "glb"; | ||
| std::string uri = "foo.glb"; | ||
|
|
||
| writer.Flush("", uri); |
Contributor
There was a problem hiding this comment.
Still need to serialize an actual valid glTF/glB file and then read it in to confirm everything works.
agrittmsft
suggested changes
Aug 29, 2018
| auto stream = streamWriter->GetInputStream(uri); | ||
|
|
||
| // Deserialize Stream -> Document | ||
| GLBResourceReader resourceReader(std::make_shared<const StreamReaderWriter>(), stream); |
Contributor
There was a problem hiding this comment.
You already have "streamWriter"
agrittmsft
approved these changes
Aug 29, 2018
Member
Author
|
internal build 11543727 passed |
fergsatwork
approved these changes
Aug 30, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adding support to write out empty glb files. "stream" was going into a failed state with m_stream was empty.