From e92c4316acfc15464e5409a5dc781253455ebcae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 7 Mar 2022 09:58:07 +0100 Subject: [PATCH] sceneconverter: properly fail --info-scenes if importing a scene fails. Somehow this was completely ignored when implementing scene info printing back in 26d2f3e9ab7547f7bc4c625d7f6103cf433f23d4. --- src/Magnum/SceneTools/sceneconverter.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Magnum/SceneTools/sceneconverter.cpp b/src/Magnum/SceneTools/sceneconverter.cpp index fc66c2e06..8f28413a9 100644 --- a/src/Magnum/SceneTools/sceneconverter.cpp +++ b/src/Magnum/SceneTools/sceneconverter.cpp @@ -419,6 +419,7 @@ is specified as well, the IDs reference attributes of the first mesh.)") }; /* Parse everything first to avoid errors interleaved with output */ + bool error = false; /* Scene properties, together with counting how much is each mesh / light / material / skin shared (which gets used only if both @@ -438,7 +439,10 @@ is specified as well, the IDs reference attributes of the first mesh.)") for(UnsignedInt i = 0; i != importer->sceneCount(); ++i) { Containers::Optional scene = importer->scene(i); - if(!scene) continue; + if(!scene) { + error = true; + continue; + } SceneInfo info{}; info.scene = i; @@ -482,7 +486,6 @@ is specified as well, the IDs reference attributes of the first mesh.)") } /* Animation properties */ - bool error = false; Containers::Array animationInfos; if(args.isSet("info") || args.isSet("info-animations")) for(UnsignedInt i = 0; i != importer->animationCount(); ++i) { Containers::Optional animation;