-
Notifications
You must be signed in to change notification settings - Fork 62
Tinygltf importer fixes #41
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
Conversation
81f12bd
to
9470d29
Compare
Hey, Gitter is giving me 504s at the moment so I can't use it -- I still didn't tag 2018.04 (saw no point in rushing it yesterday) so if you have time today, it'd be great to have it in. 👍 (I'm merging mosra/magnum#233 soon, though.) |
Signed-off-by: Squareys <squareys@googlemail.com>
Signed-off-by: Squareys <squareys@googlemail.com>
65037f9
to
6d6707c
Compare
Codecov Report
@@ Coverage Diff @@
## master #41 +/- ##
==========================================
- Coverage 87.19% 87.15% -0.04%
==========================================
Files 41 39 -2
Lines 3866 3193 -673
==========================================
- Hits 3371 2783 -588
+ Misses 495 410 -85
Continue to review full report at Codecov.
|
6d6707c
to
dcd5cce
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some generally minor things. Other than that, 👌
CORRADE_COMPARE(texture->minificationFilter(), Sampler::Filter::Nearest); | ||
CORRADE_COMPARE(texture->mipmapFilter(), Sampler::Mipmap::Linear); | ||
|
||
//CORRADE_COMPARE(texture->wrapping(), Array3D<Sampler::Wrapping>(Sampler::Wrapping::Repeat, Sampler::Wrapping::Repeat, Sampler::Wrapping::Repeat)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice to have this tested, ideally with different values for X and Y :)
if(normalAccessor.type != TINYGLTF_TYPE_VEC3) { | ||
Error() << "Trade::TinyGltfImporter::mesh3D(): expected type of normal is VEC3"; | ||
return Containers::NullOpt; | ||
if (attribute.first.compare("POSITION") == 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not just == "POSITION"
? Similarly for NORMAL below.
std::copy_n(reinterpret_cast<const Vector3*>(buffer.data.data() + bufferView.byteOffset), numNormals, std::back_inserter(normals)); | ||
|
||
/* Texture coordinate attribute ends with _0, _1 ... */ | ||
} else if (attribute.first.compare(0, 8, "TEXCOORD") == 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could use Utility::String::beginsWith()
here ;) Similarly for colors below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's longer :P (But still more readible)
Re CI failures:
|
That is probably a problem in TinyGltf... I will check it, though.
I think that's because I hand edited the file... And that are the actual contents of the file btw. (binary data is appended in .glb) Thanks for investigating, will have time to finish this up later today. |
I don't think so,
Ah I see. Probably some size information mismatch. Use some gltf-to-glb converter then, maybe? |
Signed-off-by: Squareys <squareys@googlemail.com>
Signed-off-by: Squareys <squareys@googlemail.com>
dcd5cce
to
53bbce2
Compare
You may be mixing up Apart from that, everything should be done, let's see what the CIs have to say. |
I tried very hard to find more things to complain about, but nope. I got nothing. 😆 Merged. Thanks a lot! 👍 |
Awesome, thanks! 🎉 👍 |
Hi @mosra !
As discussed, here are some fixes to the TinyGltfImporter.
Cheers, Jonathan.
TODO