-
Notifications
You must be signed in to change notification settings - Fork 439
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
[Examples Viewer Tutorial] Can't find a supported format #375
Comments
Hi! uh, sorry about this, it's a common annoyance 😅 Let me explain a bit -- there's a set of builtin plugins inside this repository, which are very rudimentary just for the very basic formats (in particular, TGA and OBJ), deliberately own code with no external dependencies as that makes things simpler for commercial users (no need to deal with 3rd party licenses and stuff). The ObjImporter in particular is quite shitty tho and there are a few stale attempts to fix it (see e.g. #205), however right now it's everything but usable. For actually usable plugins there's the magnum-plugins repository containing most of importers you'd need. A reasonable default set can be installed via For For a model, Blender's Suzanne is available in the examples repo, linking that from the example is a second TODO for me, then :) There's quite a lot of various |
Thanks for getting back!
I think that's perfectly reasonable. Personally, I'm happy to format my data to conform to the limitations of the importer, rather than complicate the importer(s) to handle more data. To benefit from that particular tutorial, I'd imagine the particular format used to import something isn't important; the important bits are getting to grips with the scene graph and plug-in mechanism in general. With that in mind, perhaps it would suffice with a provided OBJ in text form? box.obj
From there, the reader would know that even if their custom file isn't working, they've at least followed the tutorial correctly. In my case, that took a while to figure out. |
Good point about providing just a cube so even the "core" ObjImporter works, will do that as well (fourth TODO for me). The best would be to have the builtin ObjImporter updated to not be so shitty (otherwise what would be the point of even having it), but .... too much to do, too little time, so I have to prioritize. Was thinking about providing the full Suzanne instead of just a box, but in a textual form it's over a megabyte, which is a bit excessive :D I'll ping you back once I have the changes done, in case you'd have further suggestions -- you're providing a very valuable feedback, thank you! |
You are most welcome. :) And don't hesitate to ask if you want help with any of your TODO items. I'd be happy to try and take a stab at this if you'd like. |
So, if you look at latest updates to the tutorials (I already dragged you through the less-shitty Getting Started Guide, thanks for the feedback on that), there's added sections about plugins:
And then, in the Viewer tutorial, it links to a plain OBJ cube and the Suzanne model as well, plus showing what you need to enable / build / install in order to view those: https://doc.magnum.graphics/magnum/examples-viewer.html#examples-viewer-compilation |
Closing as resolved via mosra/magnum-examples@6e02ad5. |
Sorry for retouching this but I have also encountered the .obj importer failing on quadstrips... Is there an assimp model viewer example? Perhaps one might consider integrating tiny_obj_loader? I could help with some direction... Great abstraction by the way, thank you! Would it be sufficient to change, in the case of quad indices |
@freddiehonohan the builtin ObjImporter is frankly beyond shitty in its current state :) I'm planning to give it some love as part of #371, but right now you're best off just using Assimp. TinyObj is also somewhere on the TODO list, but the most effort goes into glTF support right now, this one is not really a priority. (If you'd like to contribute a plugin, you're most welcome -- just please wait until I finish #371 to avoid unnecessary work as the APIs will change quite a bit after that lands.)
In the OBJ file it's not really strips, but rather a list of quads, and the plugin takes a shortcut and fails when encountering anything that's not a triangle. Fixing this single thing could be easy (by adding quad triangulation), but there's much more missing (like materials), which still make the ObjImporter quite useless.
It's the exact same code, you just need to build plugins with Hope this is detailed enough to help you :) |
Ok great, thanks for the detailed instructions they should be a lot of help. I will let you know how I get on, thanks again! |
Hi @mosra,
I'm enjoying learning about Magnum through your very well made example library, however I'm having some issues with the Examples Viewer.
Namely, the files I'm handing it doesn't appear to load.
Fair enough, assuming "polygon" means "quad", converting the model to triangles.
Hm, allright. Maybe ZBrush is doing something different to the format that the ObjImporter doesn't like.
Hm, no message about why it didn't load this time. Maybe if I adjust the export settings?
examples_viewer.exe shipMayaAfter.obj # Importing mesh 0
Success! I made note of the description in the docs about not supporting automatic generation of normals and materials and figured maybe this was it.
This little adventure took me "out of the zone" in experiencing your set of tutorials, I think the tutorial could be improved by providing an example model. (Or if there is one, increase its visibility). You're welcome to have my ship model if you'd like; alternatively I was looking to find the model of Suzanne, like in the screenshot at the beginning of the tutorial. I think that would have been great, and I think it's open source as well?
The one I found (here) was in gltf format, which I thought would have worked, however..
And sure enough, there wasn't a plug-in by that name in there. Despite having gotten Magnum off of
vcpkg magnum[*]
(see #373) Also unsure which is mispelled, the error message or the documentation, referring toTinyGltfImporter
as opposed toGlftImporter
.In any case, hope it helps, and great work!
The text was updated successfully, but these errors were encountered: