mosra / magnum

Lightweight and modular C++11 graphics middleware for games and data visualization
https://magnum.graphics/
Other
4.81k stars 440 forks source link

Scene Viewer Example Failing on build #655

Open minoumao opened 4 hours ago

minoumao commented 4 hours ago

We were trying to build the monkey scene viewer on our personal machine (me and 4 other people) from the monkey head viewer. However, when we run the scene we get the issue where all the threads will return 1.

I dug and found out that for some reason, the command in the following:

args.addArgument("file").setHelp("file", "file to load")
    .addOption("importer", "AnySceneImporter")
        .setHelp("importer", "importer plugin to use")
    .addSkippedPrefix("magnum", "engine-specific options")
    .setGlobalHelp("Displays a 3D scene file provided on command line.")
    .parse(arguments.argc, arguments.argv);

the parse(arguments.argc, arguments.arg) is returning exit code of -1 because it fails to get an "end of line" command. We tried to figure out if it is an issue with our cmake, but because cmake compiles properly, we are unsure on what to do.

Tested and replicated this bug using the following: 1) get a base.zip magnum file 2) set up project following tutorial for monkey 3) attempt to run the project and get the thread issue.

Issue has been replicated on 5 different computers. Is this a cmake issue on our end (which is possible) or is this an bug?

We want to make it so we can load a textured file in :(

I can provide files and the cmake if need be. The code is just the viewerexample.cpp and we are using the default blender monkey.

mosra commented 3 hours ago

Hello -- I'm not sure what exactly you mean by an "end of line command", but if it exits at args.parse() it's because the example expects a path to the model to view, in a format that the library is able to understand. If you don't pass any file, it'll say so in the standard output and exit; if you pass a file that it cannot open, it'll print a message and exit as well.

Thus, something like this:

./magnum-viewer path/to/scene.glb

If you're on Windows and don't see any terminal output, remove the WIN32 part from the add_executable() command in the CMakeLists.