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
AssimpImporter: support multiple meshes per Assimp node #81
Conversation
Hi, happy to see you around :) Before I look at the code -- there was a variant of this submitted a while ago (in #68, without tests tho), is the handling in this PR different compared to that one? TinyGltfImporter implements this handling as well (see its docs), so maybe having the same behavior in both could make sense? (A potentially time-saving idea would be to reuse the same glTF test file for both and verifying both give the same result, but I have no idea how stable Assimp's glTF support is at this point.) Thank you, as always! |
Thanks for the hint, I'll take a look at #68 and TinyGltfImporter :) |
Btw., I'm not saying the approach implemented there is the best possible -- if you see any shortcomings in it, I'm open for suggestions how to make it better :) |
Well, at first glance it looks very similar to what I came up with, so of course it must be a great idea :D |
15e0b8f
to
193ed34
Compare
Codecov Report
@@ Coverage Diff @@
## master #81 +/- ##
==========================================
+ Coverage 92.21% 92.23% +0.02%
==========================================
Files 76 76
Lines 4968 4982 +14
==========================================
+ Hits 4581 4595 +14
Misses 387 387
Continue to review full report at Codecov.
|
Okay, I adapted the logic to be consistent with TinyGltfImporter and updated the documentation in AssimpImporter.h. Unit test: Assimp (at least my stock version on Ubuntu 18.04, which is admittedly a bit old) won't load the glTF test file from TinyGltfImporter (just returns an empty scene, no meshes). I'll try with a more recent Assimp version tomorrow. Currently, we only have my more basic Collada test with quad/line primitives. |
193ed34
to
47476b5
Compare
We basically introduce additional dummy objects just containing the extra meshes as childs of the original objects (which still contain the first mesh).
This tests the new support for multiple primitives and meshes per Assimp node. Mostly ported from the corresponding TinyGltfImporter test case, but using Collada format, since Assimp does not load the GLTF file properly.
47476b5
to
d1bc575
Compare
Updated again with a port of the TinyGltfImporter test case. I had to convert the example to COLLADA, because Assimp would just give me an empty scene from the gltf file. I guess this is ready for review again, but there's no rush on my end ;) |
Thank you! The test was failing on Assimp 3.2 but I couldn't be bothered trying to find a variant that works there, so it's disabled on that ancient version (on the macOS CI runner it's 4.1 and there it's tested). |
Since
Magnum::MeshObjectData3D
supports only one mesh instance, the importer has until now silently ignored any additional meshes per scene node.We now add additional child objects for any extra meshes. This adds some ugliness to
doObjectData3D()
and friends, because we need to differentiate between "original" nodes referring to Assimp nodes and the new "additional mesh" objects.This also adds a unit test using a hybrid quad/line mesh exported from blender.